0% found this document useful (0 votes)
16 views

Lab 6 IP Protocol

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Lab 6 IP Protocol

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

9.

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 Header Transport level data

IP Datagram

Fig.9.8-1 IP places the transport layer data into the datagram


The datagram is addressed to the destination host regardless its location in a local or a remote
network. Not counting few minor modifications, the datagram on the way to the destination system
preserves its initial shape. Completing the creation of the datagram, IP passes it to the data link layer
protocol to transmit it into the network.
In the process of data transmission, different systems can add different headers of the data link layer
protocols to the datagram, but the latter remains invariable. It is like sending a letter by mail, and the
IP plays the role of an envelope. On its way to the destination, the letter can find itself in various
containers, travel by train or airplane, but the envelope always remains sealed. Only the addressee is
allowed to open and use the data in the envelope.
Protocols of various OSI model layers call the structures they create differently. For instance, what is
called a frame by the data link layer protocol will be a datagram for the network layer. A more general
name for a structural unit of data on any layer is packet.
IP standard
TCP/IP protocols are described in Requests for Comments (RFC) documents, published by the Internet
Engineering Task Force (IETF). Unlike the most of network standards, TCP/IP specifications are
provided for the general use and the access to them is free in many websites, including the IETF
homepage: http://www.ietf.org. The IP protocol specifications were published in RFC 791 (September,
1981) and ratified as Internet Standard 5.

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.

Version IHL Type of Service


Total Length (2 bytes)
(4 bits) (4 bits) (I byte)

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)

Fig.9.8-2 IP datagram format


The datagram fields contain the following:
 Version (4 bits): the IP protocol version, used to create the datagram
 Internet Header Length (IHL) (4 bits): the length of the datagram header; it is expressed in 32-
bit (4-byte) words. Usually, the length of the datagram header is 5 words (20 bytes), but in case
of additional parameters included into the datagram, it can be longer. This field is used for such
cases.
 Type of Service (I byte): datagram priority code. This field allows to assign the datagram a
priority that would be taken into consideration by the routers when it is sent by the network.
 Total Length (2 bytes): the datagram length in bytes, including data and all header fields
 Identification (2 bytes): a unique identifier of the datagram. The destination host uses this
value when assembling datagrams fragmented in the process of transmission
 Flags (3 bits): the flags control the process of datagram fragmentation.
 Fragment Offset (13 bits): the value, specifying the location of the fragment in the fragmented
datagram
 Time to Live (1 byte): the number of networks, which the datagram is allowed to pass on the
way to the destination system (hop count). Each router, resending the datagram, decrements
the value in this field by 1. When the value hits 0, datagram is discarded.
 Protocol (1 byte): the code of the protocol that generated the information in the data field
 Header Checksum (2 bytes): the control checksum for the IP header fields used to detect errors
116
 Source IP Address (4 bytes): IP address of the source host that created the datagram
 Destination IP Address (4 bytes): IP address of the destination host for the datagram
 Options (variable length): optional field for one or several of 16 IP parameters. The size and
content of this field is determined by the number and types of parameters
 Data (variable length): information generated by the protocol, the code of which is indicated in
Protocol field. The size of this field depends on the data link layer protocol, used by the
network, into which the datagram is sent

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.

Step-By Step Instructions


1. With the help of a PC, two FriendlyARM Mini2440 Single-Board Computers and the network
switch build Star topology LAN (see lab assignment 9.6 Network Switch).
2. Set the names of the PCs within the LAN:
 Set the PC name as TestLab (see 8.2 Changing Computer name and Workgroup in Windows
7).
 Set the name of the first single board computer as mini2440-1 (see 8.5 Changing computer
name on the FriendlyARM Mini2440 Single-Board Computer)
 Set the name of the second single board computer as mini2440-2 (see 8.5 Changing
computer name on the FriendlyARM Mini2440 Single-Board Computer)
3. Determine IP addresses of the computers within the LAN.

118
4. Run the Wireshark program at the central PC. The main Wireshark window opens (see Fig.9.8-3
below)

Fig.9.8-3 Wireshark starting window


5. Press Capture options in the window (See. Fig.9.8-3)
6. The Traffic capture setting dialog box opens (Fig.9.8-4). With the help of this box configure the
settings to capture network packets, as shown in Fig.9.8-4.

Fig.9.8-4 Traffic capture settings dialog box


7. Press Start (See the lower right corner on Fig.9.8-4)
8. Result window panels of the captured network packets open (Fig.9.8-5).
119
Fig.9.8-5: Traffic capture results window
9. Note that the window so far is empty.
10. In the command line, enter ping mini2440-1 command (as shown in Fig.9.8-6) and press Enter.
The network traffic is initiated.

Fig.9.8-6 Output of ping mini2440-1 command in the command line window

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

Fig.9.8-8 IP datagram, captured and decoded by Wireshark program

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

You might also like