Lab 6 IP Protocol
Lab 6 IP Protocol
8 IP protocol
Lab Objectives
Acquiring knowledge on functions of the network layer protocols
Studying classification and types of network layer protocols
Acquiring knowledge on functions of Internet Protocol (IP)
IP standards
IP functions:
Encapsulation: packaging the packet of data of the transport layer into a datagram
Addressing: identification of hosts in the network by their IP addresses
Routing: finding the most effective path to the destination host
Fragmentation: breaking data into smaller fragments, by their size suitable for transmission
through the network
Protocol identification: identification of the transport layer protocol that has generated
data in the datagram
IP parameters
Practical studying and analyzing of IP datagram, transmitted through the network.
Background Information
Functions of the network layer protocols
Network layer protocol is the third layer protocol of OSI network model designed to find the path for
data transmission, including:
Translation of logical address and names into physical addresses
Finding the shortest route from the source to the destination host
Switching and routing
Tracking the failures and performance bottlenecks in the network
Fully responsible for transmission of data by the Internet network from the source host to the
destination host, this makes them different form the data link layer protocols that transmits
packets only to other hosts within the same LAN.
Classification of the network layer protocols
The network layer protocols route the data from the source to the destination host and can be divided
into two classes:
Connection-oriented protocols: they start transmitting data by establishing the route of the
packet forwarding from the source to the destination host; then they launch consecutive
transmission of data and as soon as transmission is completed they close the connection.
Connectionless protocols: they transmit the data, containing full address information in each
packet, which includes the source and destination addresses. Then each intermediate network
device reads the address information and makes a data routing decision. The data packet
passes through intermediate devices to another unless it is delivered to the destination. The
connectionless protocols do not guarantee delivery of information to the destination in the
order it was transmitted, as far as different packets can pass through different routes.
Transport protocols are responsible for restoration of the order of data when connectionless
network protocols are used.
More popular Network layer protocols:
IP/IPv4/IPv6 (Internet Protocol)
114
IPX (Internetwork Packet Exchange)
X.25 (this protocols is partly implemented on the layer 2)
CLNP (Connectionless Network Protocol)
IPsec (Internet Protocol Security)
Routing protocols
o RIP (Routing Information Protocol)
o OSPF (Open Shortest Path First)
Below we consider Internet Protocol (IP) in more details
IP (Internet Protocol) is the cornerstone of TCP/IP suite, named so by its two component protocols (IP
and TCP), providing the network transport service. Information on TCP and most of the other protocols
from the TCP/IP suite are encapsulated in the IP frame. In fact, the IP plays the role of an envelope, in
which the TCP/IP data are delivered to the destination address.
In the TCP/IP suite the IP protocol is responsible for transmission of data from the source to the
destination host. This protocol is not connection-oriented. In TCP/IP the connection-oriented services
operate on the transport layer (TCP), allowing avoiding orientation to connections on the network
layer and reducing the costs for transmission of Meta data.
The transport layer protocol, like TCP or UDP, transmits the data to the network layer, and IP
encapsulates them into a frame, adding its own header and forming a datagram, as shown in Fig.9.8-1.
IP Datagram
115
IP functions
IP protocol performs several important network functions, including:
Encapsulation: packaging the packet of the transport layer data into a datagram
Addressing: identification of systems in the network by their IP-addresses
Routing: finding the most effective path to the target host
Fragmentation: breaking down the data into fragments, by their size suitable for transmission
through the network
Identification of the transport layer protocol, which generated the data in the datagram
Encapsulation
The header, added by the IP protocol to the data, received from the transport layer protocol, is usually
20 bytes. The format of IP datagram is shown in Fig.9.8-2.
Fragment Offset
Identification (2 bytes) Flags (3 bits)
(13 bits)
Time to Live (1 byte) Protocol (1 byte) Header Checksum (2 bytes)
Source IP Address (4 bytes)
Destination IP Address (4 bytes)
Options (variable-length)
Data (variable-length)
IP addressing
IP Protocol is unique compared to the other network layer protocols as it has its own addressing
system for identification of computers in the network of almost all sizes (in other network layer
protocols, for example in NetBEUI or IPX, names or hardware addresses are used for identification of
computers in the LAN).
IP address is 32 bit and consists of the network and host identifiers. In TCP/IP host is the network
adapter of a computer or other device. Usually IP address is associated with the computer, but in fact
the address belongs to network adapter (network card). If a computer (or a router) has two adapters
installed or an adapter and a modem for remote connection with the network, it will have two IP-
addresses, one per each interface.
IP addresses, specified in the Source IP Address and Destination IP Address fields of the IP header,
identify the host that created the packet, and the destination host. If the packet will not leave the LAN
limits, the destination IP address is the same as the destination address in the data link layer protocol
header. If the packet is addressed to a host outside of the current LAN boundaries, the destination
addresses of the network layer and data link layer protocols are different.
IP – is a point-to-point protocol, i.e. it is fully responsible for delivery of the data to the destination
host, not only within the local network, as the data link layer protocol.
Data link layer protocols do not work with IP addresses, that is why in order to transmit the datagram
the IP has to communicate the hardware address of the host in the local network to the data link layer
protocol. To this end, the IP uses another protocol from the TCP/IP suite, i.e. address resolution
protocol (ARP). ARP sends a broadcast message with IP address of the host in the local network. The
host, to which this IP-address belongs, replies, substituting MAC address into the response message.
If the destination host of the datagram is within the local network, the ARP message contains its IP-
address. If the target host is in the other network, the IP address in the ARP message belongs to the
router. Receiving the reply to the ARP message, the IP protocol in the source host transmits the
datagram to the data link layer protocol, accompanying it with the MAC address, necessary for building
the frame.
Routing
Routing is the process of selection of the most effective route in the network for transmission of
datagrams form the sender to the recipient. For more details see “Routing” in “4. Stack of OSI model
protocols” section in “The computer network: Theory” documentation.
Fragmentation
Sometimes the network layer protocols have to split the fragment into several smaller fragments. This
process is called fragmentation. For more details about fragmentation see “Fragmentation” in “4.
Stack of OSI model protocols” section in “The computer network: Theory” documentation.
117
Protocol identification
To correctly handle the received datagram, the destination host has to know which protocol
generated information in the data field. To this end the information on the transport layer protocol,
from which this data is received, is specified in the “Protocol” field of the IP header. Based on this,
the recipient transmits the incoming datagrams to appropriate transport layer protocol. For more
details on protocol identification see the paragraph Protocol Identification in 4. Stack of OSI model
protocols section of The computer network: Theory documentation.
IP parameters
The optional field Options allows transmitting additional information in datagrams. For more details
about IP parameters see IP parameters in 4. Stack of OSI model protocols section in The computer
network: Fundamentals documentation.
Lab Assignment
In this assignment IP datagrams of the IP protocol are studied and analyzed with the help of Wireshark
capture and analysis program.
Requisite Equipment
Personal computer (PC) with installed network adapter and Windows 7
Wireshark program, installed in Windows 7
FriendlyARM Mini2440 Single-Board Computer (2 pcs).
NI ELVIS II workstation
NETWORK TEST BENCH board (NTB)
Network switch
Mounted network straight-through UTP cable of 5cat with RJ-45 connectors (3 pcs)
Preparations
Make sure that the required equipment is available
Make sure that a network adapter is available in the PC
Make sure that Windows Firewall is turned OFF (see 8.11 Turning OFF Windows Firewall)
With the help of NI ELVIS II workstation make sure that the network cables are mounted
properly (see lab assignment 9.1 Making and Testing the Network Cable)
Equipment should be laid out comfortably for work.
118
4. Run the Wireshark program at the central PC. The main Wireshark window opens (see Fig.9.8-3
below)
120
11. Wireshark will immediately start capturing network packets and display them in the user’s
interface (Fig.9.8-7). For more details on this window see the lab 9.10 Capture and analysis of
the network traffic with Wireshark program. It proves that the PC adapter and mini2440-1
single board computer started exchanging information through the switch.
Fig.9.8-7 The Wireshark user interface with captured network packets – filtered by IP
protocol
12. Perform filtering by IP protocol to keep only the required list of Internet protocols (pointer 1 in
Fig.9.8-7)
13. Select the first line in the upper panel of the window. It enables analyzing the content of the IP
datagram decoded in the middle window
14. Analyze the content of IP datagram:
Click on «+» next to Internet Protocol (pointer 2 in Fig.9.8-7)
In the opened hierarchic structure click on all «+» signs to make the content of these nested
structures visible
121
15. Observe the values of the main fields of the IP datagram and match them with the IP datagram
format in Fig.9.8-2, in particular:
Version - 4
Internet Header Length (IHL) – 20 bytes
Type of Service - …
Total Length - 60
Identification – 0x003c (60)
Flags – (…)
Fragment Offset - 0
Time to Live - 128
Protocol – ICMP (1)
Header Checksum – (… correct…)
Source IP Address – 169.254.122.232 (i.e. IP address of the single board computer)
Destination IP Address - 169.254.122.232 (i.e. IP address of the PC)
Options – [Source GeoIP: Unknown], [Destination GeoIP: Unknown]
Data – absent, as far as the length of Data field in this datagram is 0.
16. Turn OFF all the computers and the network switch.
122