Chapter 4.2
Chapter 4.2
Protocols:
ARP, IPv4, ICMPv4,
IPv6
McGraw-Hill © The McGraw-Hill Companies, Inc., 2004
Figure 20.1 Protocols at network layer
» In the Internet model or the TCP/IP suite, there are 5 network layer
protocols:
» ARP,
» RARP,
» IP,
» ICMP and
» IGMP.
» Fig. 20.1 below shows these protocols:
» E.g. ARP protocol is used to find the MAC (physical address) of the next
hop. (RARP is another protocol, which is, however, becoming obsolete
as it is replaced by DHCP).
» MAC is passed to data-link layer, with IP datagram to be inserted into the
encapsulating frame.
» During datagram delivery, IP needs the services of ICMP to handle
unusual situations such as occurrence of any error.
» IP is designed for uni-cast (1-source to 1-destinition )delivery, but
multimedia and other new applications in the Internet need multi-casting
(1-source to many destinations) delivery, so IP needs the services of
another protocol called IGMP.
» A MAC address is a local address, its influence is unique locally but not
necessarily universally.
» MAC address and IP address are two different identifiers.
» IP and MAC both are required as physical network, such as
Ethernet, can have different protocols at the network layer, such as
IP and IPX (Novell), at the same time.
» Similarly a packet at a network layer such as IP may pass through
different physical networks such as Ethernet and Token Ring.
» So delivery of a packet to a host or a router requires two levels of
addressing: IP and MAC.
» We need to be able to map an IP address to its corresponding MAC
address.
Mapping
Packet Format
Encapsulation
Operation
STATIC MAPPING:
» Creating a table that associates an IP address with a MAC address.
» This table is stored in each machine in the network.
» Each machine, which knows IP address of another machine on the
network, can consult to this table for MAC address.
» This method has some limitations as MAC addresses changes the
following ways:
» A machine could change its network card, resulting a new MAC
address.
» In some LANs (e.g. LocalTalk (Apple)), the MAC address changes
every time the computer is turned ON.
» A mobile computer can move from one physical network to another,
resulting in a change in its MAC address.
DYNAMIC MAPPING:
» In dynamic mapping each time a machine knows one of the two
addresses, it can use a protocol to find the other one.
» Two protocols have been designed to perform dynamic mapping:
» Address Resolution Protocol (ARP) and
» Reverse Address Resolution Protocol (RARP).
» ARP maps an IP address to a MAC address.
» RARP maps a MA address to an IP address. (RARP is becoming obsolete
as it is replaced by DHCP).
» Every host or router on the network receives and processes the ARP
query packet.
» But only the intended recipient recognizes its IP address and sends
backs an ARP response packet.
» The response packet contains:
» The recipient's IP and physical address.
» The packet is uni-cast directly to inquirer using the physical address
received in the ARP query packet.
1. The sender knows the IP address of the target. (how sender obtains will
be discussed after words).
2. IP asks ARP to create an ARP request message, filling:
» The sender IP and Physical address and
» The target IP address.
» The target physical address field is filled with 0s (as unknown).
3. The message is passed to data-link layer where it is encapsulated in a
frame.
» Using the physical address of the sender as source address and
» The physical broadcast address as the destination address.
4. Because the frame is broadcasted every host or router receives the
frame.
» All stations removes the message and pass it to ARP.
» All machines except the targeted drop the packet.
» The target machine recognizes the IP address.
5. The target machine replies with an ARP reply message that contains the
physical address.
» The message is uni-cast.
6. The sender receives the reply message as gets the physical address of
the target machine.
7. The IP datagram which carries data for target machine, is now
encapsulated in a frame and is uni-cast to the destination.
1. The sender is a host and wants to send a packet to another host on the
same net-work.
» In this case, the IP Address must be mapped to a physical address
is the destination IP address in the datagram header.
2. The sender is a host and wants to send a packet to another host on
another network.
» In this case, the hosts looks at its routing table and finds the IP
address of the next hop (router) for the destination.
» The IP address of the router becomes the IP address that must be
mapped to a physical address.
3. The sender is a router that has received a datagram destined for a host
on another network.
» It checks its routing table and finds the IP address of the next router.
» The IP address of the next router becomes the IP address that must
be mapped to a physical address.
4. The sender is a router that has received a datagram destined for a host
in the same network.
» The destination IP address of the datagram becomes the IP address
that must be mapped to a physical address.
Solution
Figure 20.6 shows the ARP request and reply packets. Note that the ARP
data field in this case is 28 bytes, and that the individual addresses do not
fit in the 4-byte boundary. That is why we do not show the regular 4-byte
boundaries for these addresses. Note that we use hexadecimal for every
field except the IP addresses.
Datagram
Fragmentation
VER (Version):
» This field defines the version of IP.
» Currently the version is 4 (IPv4), however version 6 (IPv6) might totally
replaces version 4 in the near future.
HLEN (Header Length):
» This field defines the length of the header in 4-Byte words.
» Its value must be multiplied by 4 to give the length in Bytes.
» Because of the option field the length of the header is variable.
Differentiated Services:
» This field defines the class of the data-gram for quality of service
purpose.
Total Length:
» This field defines the total length (header plus data) of the IP data-gram
in Bytes.
» To find the data coming from the upper layer, subtract the header length
from the total length.
» The header length can be found by multiplying the value in HLEN field by
4.
» Since the field is 16-bits, the total length of the IP data gram is limited to
65.535 (216-1)Bytes, of which 20 to 60 Bytes are the header and rest is
data from upper layer.
» Although 65,535 Bytes are large, the size of IP data-gram may increase in
the near future as the underlying technologies allow even more
throughput (using more bandwidth).
Total Length:
» These fields are discussed in later slides in fragmentation section.
Time to Live:
» This fields is used to control the maximum number of hops (routers)
visited by data-gram.
» When a source host sends the data-gram, it stores a number in this field.
» The value is approximately two times the maximum number of routers
between any to hosts.
» Each router that processes the data-gram decrements this number by 1.
» If the value after decrement is zero, the router discards the data-gram.
» The whole purpose is to prevent a datagram from becoming errant, going
from one outer to another.
Multiplexing
Protocol:
» This fields defines the higher-level protocol that uses the services of the
IP layer.
» An IP data-gram can encapsulates data from several higher-level
protocols such as TCP, UDP, ICMP and IGMP.
» This field specifies the final destination protocol to which the IP
datagram should be delivered.
» In other words since the IP multiplexes and de-multiplexes data from
different higher-level protocols, the value of this field helps in the de-
multiplexing process when the data-gram arrives at its final destination
as shown in Fig. 20.8 below:
Multiplexing table
Protocol:
» The value of this field for different higher-level protocols is shown in
Table 20.1 below:
VALUE PROTOCOL
1 ICMP
2 IGMP
6 TCP
17 UDP
89 OSPF
Checksum:
» The checksum in IP packet covers only the header, not the data.
» There are two good reasons for this:
» All high-level protocols that encapsulates data in the IP data-gram have
checksum field that covers the whole packet.
» The header for IP data-gram changes with each visited router, but the
data do not.
» So the checksum includes only the part that has changed.
» If the data are included, each router must recalculate the checksum for
the whole packet , which increases processing for each router.
» Fig. 20.9 in next slide shows an example of checksum calculation for an
IP header without options.
Checksum:
» Fig. 20.9 in next slide shows an example of checksum calculation for an
IP header without options.
» The header is divided into 16-bits sections.
» The value of checksum field is set to zero.
» All the sections are added and the sum is complemented.
» The result is inserted in checksum field.
Source Address:
» This field defines the IP address of the source.
» This field must remain unchanged during the time the IP datagram
travels from the source host to the destination host.
Destination Address:
» Defines the IP address of the destination.
» This field must remain unchanged during the time the IP data-gram
travels from the source host to destination host.
Options:
» Options field, as name implies, are not required for every datagram.
» They are used for network testing and debugging.
» Although options are not required part of IP header, option processing is
required of the IP software.
» So al standards must be able to handle options if they are present in the
header.
» Options are of several types.
» When a datagram is fragmented, each fragment has its own header with
most of the fields repeated but some changed.
» A fragmented datagram may itself be fragmented if it encounters a
network with an even smaller MTU.
» So datagram can be fragmented several times before it reached the final
destination.
Identification:
» Identifies the datagram originating from the source host.
» When a datagram is fragmented the value in the identification field is
copied into all fragments.
» So all fragments have the same identification number.
» The identification number helps the destination in re-assembling the
datagram.
Flags:
» A 3-bit field.
» The first bit is reserved.
» Second field called do not fragment, if it is 1, the machine must not
fragment the datagram.
» If it cannot pass the datagram through any available
physical networks, it discards the datagram and sends an
ICMP error message to the source host.
» If its value is 0, the datagram can be fragmented if
necessary.
» The third bit is called the more fragment it, if it is 1 it means the
datagram is not the last fragment , there are more fragments to
come after this one.
» If its value is 0, it means this is the last or the only
fragment.
McGraw-Hill © The McGraw-Hill Companies, Inc., 2004
IP Fragmentation Fields related to fragmentation in IP header
Fragmentation offset:
» 13-bit field shows the relevant position of this fragment with respect to
the whole datagram.
» It is the offset of the datagram in the original datagram measured in units
of 8 Bytes.
» The offsets is measured in units of 8 Bytes because the length of offset
field is 13 bits long and cannot represent a sequence of bytes greater
than 8191.
» This forces hosts or routers that fragment a datagram to choose the size
of each fragment so that the first Bytes number is divisible by 8.
Types of Messages
Error-Reporting Messages:
Destination Unreachable.
Destination Unreachable:
Source Quench.
Source Quench:
Source Quench.
Source Quench:
Time Exceeded.
Time Exceeded:
1. The router that receives the datagram with value of 0 in TTL field
discards the datagram.
» At the time of discarding the datagram a time-exceeded
message must be sent by router to the original source.
Parameter Problem.
Parameter Problem:
Redirection.
Redirection:
» For efficiency reasons the host do not take part in the routing update
process, because there are many more hosts in the internet than the
routers.
» Updating the routing tables of hosts dynamically produces unacceptable
traffic.
» The hosts usually use static routing.
Redirection.
Redirection:
» For efficiency reasons the host do not take part in the routing update
process, because there are many more hosts in the internet than the
routers.
» Updating the routing tables of hosts dynamically produces unacceptable
traffic.
» The hosts usually use static routing.
» When a host comes-up, its routing table has a limited number of entries.
» It usually knows the IP address of one router, the default router.
» For this reason, the host may send a datagram, which is destined for
another network, the wrong router.
» In this case, the router that receives the datagram will forward the
datagram to correct router.
» However, to update the routing table of a host, it sends a redirection
message back to this host.
Query:
» IPv4 has two-level address structure (netid and hostid) categorized into
five classes (A, B, C,D and E). The use of address is inefficient.
New Options:
» IPv6 has new options to allow for additional functionalities.
IPv6 Addresses
Categories of Addresses
IPv6 Packet Format
Fragmentation
ICMPv6
Transition
1. Uni-cast,
2. Any-cast, and
3. Multicast.
Uni-Cast Addresses:
» A uni-cast address defines a single computer.
» The packet sent to the uni-cast address must be delivered to that
specific host.
Any-cast Address:
» Any-cast Address defines a group of computers with addresses, that
have the same prefix.
» E.g. all computers connected to the same physical network share the
same prefix address.
» A packet sent to an any-cast address must be delivered to exactly one of
the members of the group the closest or the most easily accessible.
Multicast Address:
» A multicast address defines a group of computers that may or may not
share the same prefix and may or may not be connected to the same
physical network.
» A packet sent to a multicast address must be delivered to each member
of the set.
Version:
» 4-bit field defines the version number of the IP.
» E.g. for the IPv6 the value is 6.
Priority:
» 4-bit field defines the priority of the packet with respect to traffic
congestion.
Flow Label:
» 3-Bytes field, designed to provide special handling for a particular flow
of data.
Payload Length:
» 2-Byte field, defines the total length of the IP datagram, excluding the
base header.
Next Header:
» 8-bit field defining the header that follows the base header in the
datagram.
» The next header either:
1. One of the optional extension headers used by IP or
2. The header for an upper layer protocol such as TCP or UDP.
» Each extension header also contains this field.
Hop Limit:
» 8-bit field which serves the same purpose as the TTL (time-to-live) field
in IPv4.
Source Address:
» 16-Byte field contains the Internet Address that identifies the original
source of the datagram.
Destination Address:
» 16-Byte field contains the Internet Address that usually identifies the
final destination of the datagram.
» However, if source rerouting is used, this field contains the address of
the next router.
» If the source does not use the path MTU discovery technique, it must
fragment the datagram to a size of 756-Bytes or smaller.
» This is the minimum size of MTU required for each network connected to
the Internet.
» Fragmentation in IPv6 is handled by one of the options in the extension
header.
» Three strategies have been devised by the IETF to make the transition
period smoother as shown in Fig. 20.21 below:
Message Format
d. Time 70: The timer for 230.43.0.0 in host C expires and a membership
report is sent, which is received by the router and every host including host
A which cancels its timerfor 230.43.0.0.
Note that if each host had sent a report for every group in its
list, there would have been seven reports; with this strategy
only four reports are sent.
IP Layer
Data Link Layer
Netstat Utility
An Ethernet multicast
physical address is in the
range 01:00:5E:00:00:00
to 01:00:5E:7F:FF:FF.
b.We add the result of part a to the starting Ethernet multicast address,
which is (01:00:5E:00:00:00). The result is
01:00:5E:2B:0E:07
Solution
a.The right-most three bytes in hexadecimal are D4:18:09. We need
to subtract 8 from the leftmost digit, resulting in 54:18:09..
We can show how IGMP can handle the sending and receiving of IGMP
packets through our simplified version of an IGMP package. In our
design an IGMP package involves a group table, a set of timers, and four
software modules.
24.
117
Figure 24.1 Traffic descriptors
24.
118
Figure 24.2 Three traffic profiles
24.
119
24-2 CONGESTION
24.
120
Congestion Control Algorithms
• Congestion - the situation in which too
many packets are present in the subnet.
Causes of Congestion
• Congestion occurs when a router receives
data faster than it can send it
– Insufficient bandwidth
– Slow hosts
– Data simultaneously arriving from multiple
lines destined for the same outgoing line.
• The system is not balanced
– Correcting the problem at one router will
probably just move the bottleneck to another
router.
Congestion Causes More Congestion
– Incoming messages must be placed in queues
• The queues have a finite size
– Overflowing queues will cause packets to be dropped
– Long queue delays will cause packets to be resent
– Dropped packets will cause packets to be resent
• Senders that are trying to transmit to a congested
destination also become congested
– They must continually resend packets that have been
dropped or that have timed-out
– They must continue to hold outgoing/unacknowledged
messages in memory.
Congestion Control versus Flow Control
• Flow control
– controls point-to-point traffic between sender
and receiver
– e.g., a fast host sending to a slow host
• Congestion Control
– controls the traffic throughout the network
24-3 CONGESTION CONTROL
24.10
Congestion Control
11
Two Categories of Congestion Control
• Open-loop approach
– Problem is solved at the design cycle
– Once the system is running midcourse correction are NOT made.
– Tools for doing open-loop control:
• Deciding when to accept new traffic,
• Deciding when to disregard packets and which ones.
• Making scheduling decision at various points in the network.
• Note that all those decisions are made without regard to the current state of the
network.
General Principles of Congestion Control
• Closed-loop approach
– It is based on the principle of feedback-loop. The approach has
three parts when applied to congestion control:
1. Monitor the system to detect when and where congestion occurs,
2. Pass this information tot places where action can be taken
3. Adjust system operation to correct the problem.
Figure 24.5 Congestion control
categories
24.15
Warning Bit/ Backpressure
• A special bit in the packet header is set by the
router to warn the source when congestion is
detected.
• The bit is copied and piggy-backed on the ACK
and sent to the sender.
• The sender monitors the number of ACK
packets it receives with the warning bit set
and adjusts its transmission rate accordingly.
16
Figure 24.6 Backpressure method for alleviating congestion
24.17
Choke Packets
• A more direct way of telling the source to
slow down.
• A choke packet is a control packet
generated at a congested node and
transmitted to restrict traffic flow.
• The source, on receiving the choke packet
must reduce its transmission rate by a
certain percentage.
• An example of a choke packet is the ICMP
Source Quench Packet.
18
Figure 24.7 Choke
packet
24.19
Open-Loop Control
• Network performance is guaranteed to all
traffic flows that have been admitted into the
network
• Initially for connection-oriented networks
• Key Mechanisms
– Admission Control
– Policing
– Traffic Shaping
– Traffic Scheduling
Admission Control
• Flows negotiate contract with
network
Peak rate
• Specify requirements:
– Peak, Avg., Min Bit rate
Bits/second
24.
142
Figure 24.20 Leaky bucket
implementation
24.
143
Note
A leaky bucket algorithm shapes bursty traffic into fixed-rate traffic by averaging the
data rate. It may drop the packets if the bucket is full.
24.
144
Note
The token bucket allows bursty traffic at a regulated maximum rate.
24.
145
Leaky Bucket Traffic Shaper
Size N
Incoming traffic Shaped traffic
Server
Packet
5-34
24.34
Token Bucket Traffic Shaper
Tokens arrive
periodically
Size N
Incoming traffic Shaped traffic
Server
Packet
• Token rate regulates transfer of packets
• If sufficient tokens available, packets enter network without delay
• K determines how much burstiness allowed into the network
Leaky Bucket vs Token Bucket
• LB discards packets; TB does not. TB
discards tokens.
• With TB, a packet can only be transmitted if
there are enough tokens to cover its length
in bytes.
• LB sends packets at an average rate. TB
allows for large bursts to be sent faster by
speeding up the output.
• TB allows saving up tokens (permissions) to
send large bursts. LB does not allow
saving.
Load Shedding
• When buffers become full, routers simply discard
packets.
• Which packet is chosen to be the victim depends on
the application and on the error strategy used in
the data link layer.
• For a file transfer, for, e.g. cannot discard older
packets since this will cause a gap in the received
data.
•For real-time voice or video it is probably better to
throw away old data and keep new packets.
• Get the application to mark packets with discard
priority.