Chap10-IP Protocols - Sao Chép
Chap10-IP Protocols - Sao Chép
IP PROTOCOLS
10.1 About This Chapter
The Internet Protocol (IP) is the centre piece of the Internet and IP-suite of
protocols. It established itself as the most widely-used data networking protocol. It
provides an interface function on which the Internet is based. IP is used not only in end
devices which access the Internet but also between the nodes of wide area data networks.
A good understanding of IP is necessary to continue on to TCP and UDP, because
the IP is the component that handles the movement of datagrams across a network.
Knowing how a datagram must be assembled and how it is moved through the networks
helps you understand how the higher-level layers work with IP. For almost all protocols in
the TCP/IP family, IP is the essential element that packages data and ensures that it is sent
to its destination.
Although the IP version 4 was robust at the time of its publication in 1981, it did not
anticipate several Internet advances. These advances are taken in consideration by IP
version 6 which made many improvements on internet protocol to accommodate the
development of the Internet. IP version 6 was referred to as IP the Next Generation (IPng).
Other protocols are necessary to handle error reporting, Multicasting and group
managements. ICMP is an error-reporting system. It is an integral part of IP and must be
included in every IP implementation. This provides for consistent, understandable error
messages and signals across the different versions of IP and different operating systems.
Group membership on a single network is communicated between systems by the
IGMP protocol. Multicast routers propagate group membership information using
multicast routing protocols a standard IP router may support multicast routing, or multicast
routing may be handled by a router dedicated to that purpose.
There are a lot of experimental applications on the Internet that take advantage of
multicasting include audio and video conferencing applications, resource discovery tools,
and shared whiteboards.
The Address Resolution Protocol (ARP) is designed to convert IP addresses to
MAC addresses, while the Reveres Address Resolution Protocol (RARP) works in the
opposite direction. Suppose that a user wants to transmit a packet to its destination.
This chapter describes how wide area networks can use the Internet Protocol. We
will discuss in detail the two most important variations of the Internet protocol—version 4
(IPv4) and version 6 (IPv6). We shall cover the functions and describe the structure of an
IP packet and the basic IP processing including input, forwarding, and output. Option
processing and fragmentation and reassembly will be discussed. The construction of the IP
header is important to many TCP/IP family protocol members, so you can use this
knowledge in later chapters.
32 COMPUTER NETWORKS AND
This chapter will also cover the basics of ICMP, IGMP, ARP, and RARP protocols,
their fundamental operations and functions, their characteristics, and how their data units
are built and transferred.
has been adapted to run over these protocols. TCP/IP was first used to interconnect
computer systems through synchronous lines and high-speed local area networks.
Today, it is used on any type of medium. This includes serial (asynchronous and
synchronous) and high-speed networks such as FDDI, Ethernet, and token Ring.
Let’s start with understanding the functions and protocols by studying their
placement in the OSI model. In looking at Figure10.1, we can see that there are
distinct protocols that run at each layer of the OSI model, starting from the network
layer to the application layer. The heart of the TCP/IP network protocol is at layers 3
and 4. The applications for this protocol (file transfer, mail, and terminal emulation)
run at the application layer.
Protocol suite is a collection of protocols that work together as a group. Examples of protocol suites inc
IP Protocol
2“ DLL Protocol 3" DLL Protocol 4"' DLL Protocol
Source
Destination
Figurc 10.2: Scndcr scnding IP datagram cncapsulatcd into data link laycr framc
The sender wants to send an IP datagram to the recipient with the IP address IP2. It
creates an IP datagram, but to insert it into a local network, the sender must insert it into a
data link frame which has the sender's MAC 4 address and the recipient’s MAC 5 address.
The data can only travel through the link protocol to router 1, which unpacks the IP
datagram from the Ethernet frame and looks at the recipient’s IP address. Depending on
the recipient’s IP address, it decides to which of its routers the IP datagram should be sent,
i.e., on which link protocol the IP datagram should be encapsulated based on its
routing table. In our example the routers have decided on the HDLC line. So the IP
datagram is encapsulated into an HDLC frames.
Our IP datagram is transported via the HDLC protocol through the routers to the
final router, which again unpacks the IP datagram from the HDLC envelope and, after
wrapping it in a data link layer envelope, inserts it into the destination LAN. The IP
datagram is again encapsulated into a data link layer frame which has the sender’s MAC 4
address and the recipient’s MAC 5 address.
M High-level Data Link Control (HDLC) is a standard synchronous communication protocol at the data
S Routing.
S Fragmentation of datagrams.
Figure 10.3: The IP v4 data unit encapsulated in data link layer frame
The IP packet is composed of several fields as shown in Figure 10.2. Instead of
referring to the length of IP packets according to bits and bytes, the IP frame uses a length
measurement of 32 bits referring to that grouping as a word. Consequently, any diagrams
used to illustrate IP frame construction will divide the frame into 32-bit words.
S The first field is four bits in length and is called the version field. It contains the
version number of the IP software used to create the datagram so that any device
along the way that looks at the datagram will know what format it is in.
IP 32
source and destination fields are next. Each address is 32 bits in size and contains
a unique IP address. The next to last 32-bits field is a variable length field known
as the options field. It is used to allow additions to the header information such as
strict source route, loose source route, record route, time stamps, security, or
padding. Finally there is the data itself.
Figure 10.4: The IP data unit encapsulated in data link layer frame
IP 32
Version: The IP version field has the value 6 rather than the value 4 found in
IP version 4.
Priority: The priority field contains four bits describing the traffic class. This field
prioritizes which datagrams are less important and can be discarded when the
router is forced to discard certain IP datagrams.
Flow label: This field along with the source address identifies individual data
flows on the Internet. When datagrams reach the router, they are stored in the
queue. The router simply searches its cache. If it finds no matches, it solves the
routing task for that particular datagram as well. But the datagrams of the same
flow are automatically sent to the interface selected for the first one. In the result
the router dose not solve the same task for thousands of datagrams with the same
result.
Payload length: This field specifies the total length of the IP datagram excluding
the Base header. The maximum length of the datagram transferred might be
65,535 bytes. It is also possible, however, to use a larger datagram from the next
header of the router information that enables sending even larger datagrams
(jumbograms).
Next header: It specifies the next header type.
Hop limit: TTL field in IP v4 is replaced with the hop limit. The hop limit is
decreased every time the IP datagram passes through a router. When it reaches 0,
the datagram is considered lost and, subsequently, discarded.
& The hop is a logical distance between networks based on the number of routers that must be traversed by
M IPv6 and IPv4 nodes can peacefully coexist on a network using tunneling. This is a technology for sending
IP 32
10.5.5 Mobile IP
Today’s computers are smaller and more mobile than they used to be. They can now
be easily carried around and be used anywhere. A lot of people generally want to read their
e-mail and access their normal file systems wherever in the world they may be using their
portable computers. A user may now disconnect his computer in the office and reconnect
from another site within the same office or elsewhere.
In wireless connectivity the point of attachment may change even while the user is
connected since the user may travel between Base stations of a wireless LAN or a mobile
phone system.
33 COMPUTER NETWORKS AND
Mobile IP allows a node to change its point of attachment to the Internet without
needing to change its IP address. This is not simply a configuration simplification, but can
facilitate continuous application-level connectivity as the node moves from point to point.
In most mobile IP cases, TCP cannot be used, as the congestion-control scheme
would greatly reduce the throughput and the inherent delays and error bursts may result in
a large number of retransmissions. Mobile IP faces many challenges such like mobility,
registration, interoperability, connection reliability and security. We will cover the mobile
IP issues in chapter 12.
& A mobile node must be able to communicate with other nodes after changing its link-layer point of attachm
M Ping stands for Packet Internet Groper, a TCP/IP utility that verifies the integrity of a network connection
0 1 2 31
Figure 10.6: ICMP v4 Packet format and how it is encapsulated in the MAC frame
& ICMP is a TCP/IP network layer protocol used by routers and TCP/IP hosts for building and mainta
The first four bytes of the header always contain the message type, message
code, and a 16-bit checksum. The message format depends on the value of the type
field. The Message Type indicates which ICMP message is present, and the
Message Code qualifies this for meaning specific to the type of message. Table
10.3 lists the ICMP message types.
3 Address unreachable
4 Port unreachable
2 0 Packet too big
3 Time exceeded
0 Hop limit exceeded in transit
1 Fragment reassembly time exceeded
4 Parameter Problem
0 Erroneous header field encountered
1 Unrecognized Next header
2 Unrecognized IP version 6 option encountered
128 0 Echo request
129 0 Echo reply
133 0 Router solicitation
134 0 Router advertisement
135 0 Neighbor solicitation
136 0 Neighbor advertisement
137 0 Redirect message
Table 10.4: The function of the ICMP v6 messages
All control messages that were not used such as timestamp, timestamp reply, source
quench, information request and reply are moved and most of there functions are
incorporated into other protocols.
The format of the ICMPv6 header is the same format as ICMPv4. The type field
indicates the type of the message. Its value determines the format of the remaining data.
Error messages are identified as such by 0 a 0 in the high-order bit of their message Type
field values. Thus, error messages have message Types from 0 to 127; informational
messages have message Types from 128 to 255. The code field depends on the message
type and further identifies the ICMP message.
ICMPv6 is not backwards compatible with ICMPv4. It uses the next-header
function of IP and the next-header type of 56.
ICMP redirects can modify a router’s routing table, so sometimes hackers try to subvert routers by issui
the fact that each host has a unique IP unicast address that is completely independent
of the address of the multicast group in which it is participating.
An IP multicast group, also known as a host group, is a set of hosts with an
assigned multicast IP address. Members of the group still retain their own IP addresses,
but also have the ability to absorb data that has been sent to the multicast address. Any
system may belong to zero or more multicast groups. IP multicast traffic is sent to a single
MAC address but processed by multiple IP hosts. A specific host listens on a specific
IP multicast address and receives all packets to that IP address. The following are some of
the additional aspects of IP multicasting:
H Host group membership is dynamic; hosts can join and leave the group at any
time.
A host group can be of any size.
Members of a host group can span IP routers across multiple networks. This
situation requires IP multicast support on the IP routers and the ability for hosts to
register their group membership with local routers. Host registration is
accomplished using IGMP.
A host can send traffic to an IP multicast address without belonging to the
corresponding host group.
member member
IP 1 IP 2
member
IP 8
IP 3
IP 7
MCI
Address
member
IP 4
IP 6
member
IP 5
-->
& Multicast is based on the concept of a group. An arbitrary group of receivers expresses an interest in
33 COMPUTER NETWORKS AND
0 19 20 27
MMembership in a multicast group on a given interface is dynamic-it changes over time as processes join a
Implied here is that a host identifies a group by the group address and the interface.
A host must keep a table of all the groups that at least one process belongs to, and a
reference count of the number of processes belonging to the group.
The Internet Group Management Protocol (IGMP) provides a dynamic service to
registered individual hosts in a multicast group on a particular network. It is used for
TCP/IP between a receiver and its immediate multicast-enabled routers reporting multicast
group information. This protocol has several versions and is required on all machines that
receive IP multicast.
S Version: 8 bits Field indicate the message type, which may be one of the
following:
o 0x11: IP Membership query ("Are there any members on the LAN?")
o 0x12: IGMPv1 Membership Report
o 0x16: IGMPv2 Membership Report
o 0x17: IGMPv2 Leave Group
Hosts send IGMP membership reports corresponding to a particular multicast group,
expressing an interest in joining that group.
S Maximum Response Time (MRT): 8 bits field is used only in router requests and
specifies (in tenths of a second) the time that members of the group have to repeat
their requests for membership in the group. In all other cases, the MTR field has a
value of 0.
S Checksum: 16 bits field is calculated to control the errors that may have occurred
in the header.
S IP group address: field is zero for a general request, and in all other cases,
specifies the particular IP address of a multicast.
16 31
Group addresses
Vcrsion Checksum
Group IP addresses
(D)
Figurc 10.9: IGMP Data Unit, Vcrsion I (A), Vcrsion 2 (B), Vcrsion 3 (C), and thc othcr
common part included in all version's data unit
IGMP version 3 supports two modes:
o Include mode: In this mode a receiver announces the membership to a
host group and provides a list of source addresses from which it wants
to receive traffic.
o Exclude mode: With this mode, a receiver expresses the membership to a
multicast group and provides a list of source addresses from which it does
not want to receive traffic.
With the leave group message, hosts can report to the local multicast router that they
intend to leave the group. If any remaining hosts are interested in receiving the traffic, the
33 COMPUTER NETWORKS AND
router transmits a group-specific query. In this case, if the router receives no response, the
router times out the group and stops forwarding the traffic.
Every IGMP data unit contains the flowing common fields:
S Resv: The Resv field is set to 0 and is reserved for future development.
S S flag: This is one bit field to suppress router-side processing.
S QRV: three bits field indicates the querier’s robustness variable.
S QQIC: 8 bits field indicates the querier's query interval code.
S N: 16 bits field shows the number of sources
S Source Address |i]: provides a vector of N individual IP addresses.
H Due to the dynamic nature of the IPv6 and its Neighbor Discovery protocols (routers and hosts), IGMP fun
W ARP is plug-and-play, that is, a node’s ARP table gets built automatically, and it doesn’t have to be
MAC a
IP b f
MAC b
MAC c LANl
c MAC d
IP c
IP d
Figure 10.10: Each node on a LAN has an IP address, and each node’s adapter has a
Physical address.
When passed the IP datagram and the Physical address, the sending node’s adapter
can construct a data link layer frame and broadcast the frame into the LAN. The ARP
module in each node has a table in its RAM called an ARP table. This table contains
the mappings of IP addresses to Physical addresses.
Sending node needs to obtain the Physical address of the destination node, given the
IP address of that node. This task is easy if the destination node has an entry in the sending
node’s ARP table.
IP address Physical address TTL
IP b MAC b 13:45:00
IP c MAC c 13:52:00
Table 10.5: A possible ARP table in node A
U Each host has exactly one IP address and one adapter, while each router has an IP address for each of
IP 34
MThe query ARP message is sent within a broadcast frame whereas the response ARP message is sen
& Neighbor discovery (ND) is introduced; it uses ICMPv6 messages in order to determine link-layer addresse
& There are other protocols for address assignment that do a better translation such as BOOTP and DHCP be
The packet format for a RARP packet is the same as for ARP. The only difference is
that the field that will be filled in will be the sender’s physical address. The IP address
fields will be empty. A RARP server will receive this packet, fill in the IP address fields,
and reply to the sender—the opposite of the ARP process.
RARP suffers from the same problems as static addressing. As a RARP server
maintains a data base relating hardware addresses to IP addresses, any change in the IP
addressing scheme requires a manual update of the data base. Thus, maintenance of a large
RARP data base can be expensive.
IP is a best-effort datagram service that provides the delivery mechanism for all
other Internet protocols. The standard IP header is 20 bytes long, but may be
followed by up to 40 bytes of options. IP can split large datagrams into fragments
to be transmitted and reassembles the fragments at the final destination.
In addition to internetwork routing, IP provides error reporting and fragmentation
and reassembly of datagrams for transmission over networks with different
maximum data unit sizes.
IP version 6 has not only enlarged the IP address size from 4 to 16 bytes, but also
offers a revamped view of the IP datagram. One of the more interesting changes to
IP with version 6 is the concept of concatenated headers. Extension headers form
chains. The chain contains only those headers that are necessary. IPv6 and IPv4
nodes can peacefully coexist on a network using tunneling.
Today’s computers can now be easily carried around and used anywhere. In
wireless connectivity the point of attachment may change, Mobile IP allows a node
to change its point of attachment to the Internet without needing to change its
IP address.
ICMP is a service protocol that is part of IP. It is used to signal abnormal events in
networks built on the IP protocol. ICMP packets are wrapped into an IP datagram.
This protocol offers flow control and error-detection to the unreliable delivery
method of IP. One of the most common uses for ICMP is the PING program.
ICMPv6 is not backwards compatible with ICMPv4.
IP v 6 uses an ICMP v 6 protocol. It offers different functionality than the previous
version of ICMP. For example, ICMP v 6 deals with the translation of IP addresses
into link addresses.
Internet Group Management Protocol solves many problems associated with
multicast addressing
IGMP communicates IP multicast membership information between hosts and
routers on a single network. IGMP membership reports are generated when an
interface joins a group, and on demand when multicast routers issue an IGMP
report query message.
Multicast routers share the IGMP information they collect with each other to route
multicast datagrams toward remote members of the multicast destination group.
ARP provides the dynamic mapping between IP addresses and hardware addresses.
It functions as a translator between IP addresses and Physical addresses.
RARP can be used to obtain an IP address from the host’s hardware address, when
a network station knows its MAC address but does not know its IP address. It
is suited to diskless hosts on a small network.
b. ARP d. ICMP
19. Which oh the following is TRUE statment about ICMP?
a. ICMP can correct detected errors
b. ICMP identifies and corrects network errors
c. ICMP cannot correct detected errors
d. ICMP can correct but cannot identify network errors
20. What is the network layer protocol that obtains the MAC (physical) address of a host,
or node, then creates a data base that maps the MAC address to the host’s IP (logical)
address?
a. ARP c. UDP
b. IP d. DNS
21. Which of the following is TRUE statment about ARP?
a. ARP creates an ARP table for efficiency
c. ARP creates an ARP table for security
b. ARP does not create a MAC-to-IP table
d. ARP table and ARP cache are two completely different things
22. type(s) of entries an ARP table can contain.
a. 1 c. 2
b. 3 d. 4
23. What are the ARP table entries that are created when a client makes an ARP
request that cannot be satisfied by data already in the ARP table?
a. Fixed entries c. Static entries
b. New entries d. Dynamic entries
24. is the name of the protocol that allows a client to send a broadcast message with
its MAC address and receive an IP address in reply.
a. ARP c. RARP
b. DNS d. RDNS
25. kind(s) of addresses a network can recognize.
a. 2 c. 3
b. 4 d. 5
26. is the core protocol responsible for logical addressing for TCP/IP.
a. MAC c. TCP
b. ARP d. IP
27. are a PDU used at the network layer.
a. Packets c. Bits
b. Frames d. Segments
28. is a Network layer protocol used to resolve a logical (IP) address to a physical
(MAC) address.
a. ICMP c. DHCP
b. ARP d. NAT
29. How many different fields does the IP header have?
a. 5 c. 14
b. 10 d. 28
30. In the Internet Protocol, the Destination IP Address field is examined by a
a. bridge. c. switch.
b. router. d. server.
IP 34
31. What is the layer in the TCP/IP model that handles software, or logical, addressing?
a. Internetwork c. Transport
b. Application d. Network Interface
32. What is the protocol that resolves IP addresses to MAC addresses for source hosts that
knows the IP addresses of the destination host but not the MAC address?
a. ICMP c. RARP
b. ARP d. CARP
33. How many different groups of IP addresses exist on the Internet?
a. Three c. Five
b. Four d. Six
34. What is the name of tables of the MAC and IP addresses of other devices on the
network that many network devices maintain?
a. reference c. ARP
b. destination d. APR
35. The device that discovers its own IP address in the IP header of the ARP request
packet reads the rest of the packet and returns an ARP
a. confirm c. answer
b. ACK d. reply
36. can route between autonomous systems.
a. IGRP c. BGP
b. RIP d. IGP