Packet Switching Networks:Internet Protocol.
Internet Protocol
· It provides best effort, connectionless packet delivery, packets may be lost, out of order, or even duplicated, so it is the responsibility of higher layer protocols to deal with these, if necessary.
· The header is of fixed-length component of 20 bytes plus variable-length consisting of options that can be up to 40 bytes.
Version: This field identifies the current IP version and it is 4.
Internet header length (IHL): It specifies the length of the header in 32-bit words. If no options are used, IHL will have value of 5.
Type of service (TOS): This field specifies the priority of packet based on delay, throughput, reliability and cost. Three bits are used to assign priority levels and four bits are used for specific requirement (i.e. delay, throughput, reliability and cost).
Total length: The total length specifies the number of bytes of the IP packet including header and data, maximum length is 65535 bytes.
Identification, Flags, and Fragment Offset: These fields are used for fragmentation and reassembly.
Time to live (TTL): It specifies the number of hops; the packet is allowed to traverse in the network. Each router along the path to the destination decrements this value by one. If the value reaches zero before the packet reaches the destination, the router discards the packet and sends an error message back to the source.
Protocol: specifies upper-layer protocol that is to receive IP data at the destination. Examples include TCP (protocol = 6), UDP (protocol = 17), and ICMP (protocol = 1).
Header checksum: verifies the integrity of the IP header of the IP packet.
· IP header uses check bits to detect errors in the header
· A checksum is calculated for header contents
· Checksum recalculated at every router, so algorithm selected for ease of implementation in software
Source IP address and destination IP address: contain the addresses of the source and destination hosts.
Options: Variable length field allows packet to request special features such as security level, route to be taken by the packet, and timestamp at each router. Detailed
descriptions of these options can be found in [RFC 791].
Padding: This field is used to make the header a multiple of 32-bit words.
IP Header Processing
1. Compute header checksum for correctness and check that fields in header (e.g. version and total length) contain valid values
2. Consult routing table to determine next hop
3. Change fields that require updating (TTL, header checksum)
IP Addressing
· RFC 1166
· Each host on Internet has unique 32 bit IP address
· Each address has two parts: Netid and Hostid
· Netid is unique & administered by
o American Registry for Internet Numbers (ARIN)
o Reseaux IP Europeens (RIPE)
o Asia Pacific Network Information Centre (APNIC)
· The Net ID identifies the network the host is connected to.
· The host ID identifies each individual system connected to network.
· Dotted Decimal Notation is used for representation:
· The IP address of 10000000 10000111 01000100 00000101 is 128.135.68.5 in
dotted-decimal notation
Classful IP Addresses
· The IP address structure is divided into five address classes: Class A, Class B, Class C, Class D and Class E
· The class is identified by the Most Significant Bit (MSB) of the address as shown
below.
· Class A has 7 bits for network IDs and 24 bits for host IDs, allowing up to 126 networks and about 16 million hosts per network.
· Class B has 14 bits for network IDs and 16 bits for host IDs, allowing about 16,000 networks and about 64,000 hosts per network.
· Class C has 21 bits for network IDs and 8 bits for host IDs, allowing about 2 million networks and 254 hosts per network.
· Class D addresses is used for multicast services that allow host to send information to a group of hosts simultaneously.
· Class E addresses are reserved for experiments.
Subnet Addressing
· Subnet addressing was introduced in the mid 1980s when most large organizations are moving their computing platforms from mainframes to networks of workstations.
· Subnetting adds another level of hierarchical level called “Subnet”.
· Inside the organization the network administrator can choose any combination of lengths for subnet and host ID fields.
· Example: - consider an organization that has been assigned a class B IP address with a network ID of 150.100. Suppose the organization has many LANS, each consisting of not more than 100 hosts. Then seven bits are sufficient to uniquely identify each host in a subnetwork. The other nine bits can be used to identify the subnetworks
within organization
· To find the subnet number, the router needs to store an additional quantity called subnet mask, which consists of binary 1s for every bit position of the address except
the host ID field where binary 0s are used.
· For the IP address 150.100.12.176, the subnet mask is11111111 11111111 11111111 10000000, which corresponds to 255.255.255.128.
· The router can determine the subnet number by performing a binary AND between subnet mask and the IP address.
The IP address is 10010110 01100100 00001100 10110000 i.e. 150.100.12.176
AND with subnet mask 11111111 11111111 11111111 10000000 i.e. 255.255.255.128
to get subnet number 10010110 01100100 00001100 10000000 i.e.150.100.12.128
and which is also called as First Address and is used to identify the subnetwork inside the organization.
· The IP address 150.100.12.255 is used to broadcast packets inside the subnetwork.
Thus the host connected to subnetwork must have IP address in the range 150.100.12.129 to 150.100.12.254.
IP Routing
- IP layer in end-system hosts and in the router work together to route packets from source to destination.
- IP layer in each host and router maintains a routing table, which is used to route the packets based on IP address.
- If a destination host is directly connected to the originating host by a link or by a LAN, then the packet is sent directly to destination host using appropriate network interface, otherwise, the routing table specifies that the packet is to send to default gateway.
- When a router receives an IP packet from one of the network interfaces, then router
- examines its routing table to see whether the packet is destined to itself or not, if so, delivers to router’s own address, then the router determines the next–hop router and associated network interface, and then forwards the packet.
- Each row in routing table must provide information like: destination IP address, IP address of next-hop router, several flag fields, outgoing network interface, and other information such as subnet mask, physical address.
- H flag indicates whether the route in the given row is to a host (H=1) or to a network.
- G flag indicates whether the route in the given row is to a router (gateway, G=1) or to a directly connected destination (G=0).
- Each time a packet is to be routed, the routing table is searched in the following order.
- First, the destination column is searched to see whether table contains an entry for complete destination IP address.
- If so, then IP packet is forwarded according to next-hop entry and G flag.
- Second, if the table does not contain complete destination IP address, then routing table is searched for the destination network ID.
- If an entry found, the IP packet is forwarded according to next-hop entry and G flag.
- Third, if table does not contain destination network ID, the table is searched for default router entry, and if one is available, the packet is forwarded there.
- Finally if none of the above searches are successful, the packet is declared undeliverable and an ICMP “host unreachable error” packet is sent back to
originating host.
CIDR
- CIDR stands for Classless Inter-Domain Routing.
- CIDR was developed in the 1990s as a standard scheme for routing network traffic across the Internet.
- Before CIDR technology was developed, Internet routers managed network traffic based on the class of IP addresses. In this system, the value of an IP address determines its subnetwork for the purposes of routing.
- CIDR is an alternative to traditional IP subnetting that organizes IP addresses into subnetworks independent of the value of the addresses themselves. CIDR is also known as supernetting as it effectively allows multiple subnets to be grouped together for network routing.
CIDR Notation: - CIDR specifies an IP address range using a combination of an IP address and its associated network mask. CIDR notation uses the following format -
xxx.xxx.xxx.xxx/n
where n is the number of (leftmost) '1' bits in the mask. For example,
192.168.12.0/23 applies the network mask 255.255.254.0 to the 192.168 network, starting at 192.168.12.0. This notation represents the address range 192.168.12.0 - 192.168.13.255. Compared to traditional class-based networking, 192.168.12.0/23 represents an aggregation of the two Class C subnets 192.168.12.0 and 192.168.13.0 each having a subnet mask of 255.255.255.0. In other words,
192.168.12.0/23 = 192.168.12.0/24 + 192.168.13.0/24
Additionally, CIDR supports Internet address allocation and message routing independent of the traditional class of a given IP address range. For example,
10.4.12.1 represents the address range 10.4.12.0 - 10.4.15.255 (network mask 255.255.252.0). This allocates the equivalent of four Class C networks within the much larger Class A space.
You will sometimes see CIDR notation used even for non-CIDR networks. In non-CIDR IP subnetting, however, the value of n is restricted to either 8 (Class A), 16 (Class B) or 24 (Class C). Examples:
- 10.0.0.0/8 172.16.0.0/16
- 192.168.3.0/24
CIDR aggregation requires the network segments involved to be contiguous (numerically adjacent) in the address space. CIDR cannot, for example, aggregate 192.168.12.0 and 192.168.15.0 into a single route unless the intermediate .13 and .14 address ranges are included (i.e., the 192.168.12/22 network).
ARP (Address Resolution Protocol)
- The address resolution protocol (ARP) is a protocol used by the Internet Protocol (IP) specifically IPv4, to map IP network addresses to the hardware addresses used by a data link protocol.
- The protocol operates below the network layer as a part of the interface between the OSI network and OSI link layer. It is used when IPv4 is used over Ethernet.
- It is also used for IP over other LAN technologies, such as Token Ring, FDDI, or IEEE 802.11, and for IP over ATM.
- ARP is a Link Layer protocol because it only operates on the local area network or point-to-point link that a host is connected to.
- The hardware address is also known as the Medium Access Control (MAC) address, in reference to the standards which define Ethernet.
- The Ethernet address is a link layer address and is dependent on the interface card which is used.
- IP operates at the network layer and is not concerned with the link addresses of individual nodes which are to be used. The ARP is therefore used to translate IP addresses into MAC address.
- In the below figure suppose host H1 wants to send an IP packet to H3, but does not know the MAC address of H3. H1 first broadcast an ARP request packet asking the destination host, which is identified by H3’s IP address, to reply. All hosts in the network receive the packet, but only the intended host, which is H3, responds to H1.
- The ARP response packet contains H3’s MAC address and IP addresses.
- H1 caches H3’s MAC address in its ARP table so that H1 can simply look up H3’s MAC address in the table for future use.
- The ARP client and server processes operate on all computers using IP over Ethernet. The processes are normally implemented as part of the software driver that drives the network interface card.
RARP (Reverse Address Resolution Protocol)
- RARP is a link layer networking protocol, used to resolve an IP address from a given hardware address (such as an Ethernet address).
- RARP requires one or more server hosts to maintain a database of mappings from Link Layer address to protocol address.
- To obtain its IP address, the host broadcasts an RARP request packet containing its MAC address on the network.
- All hosts in the network receive the packet, but only the server replies to the host by sending an RARP response containing the host’s MAC and IP address.
IP fragmentation and Reassembly
- The Internet Protocol allows IP fragmentation so that datagrams can be fragmented into pieces small enough to pass over a link with a smaller MTU than the original datagram size.
- The Identification field, and Fragment offset field along with Don't Fragment and More Fragment Flags are used for Fragmentation and Reassembly of IP datagrams.
- In a case where a router in the network receives a PDU larger than the next hop's MTU, it has two options. Drop the PDU and send an ICMP message which says "Packet too Big", or to Fragment the IP packet and send over the link with a smaller MTU.
- If a receiving host receives an IP packet which is fragmented, it has to reassemble the IP packet and hand it over to the higher layer.
- Reassembly is intended to happen in the receiving host but in practice it may be done by an intermediate router, for example network address translation requires re-calculating checksums across entire packets, and so routers supporting this will often recombine packets as part of the process.
- The details of the fragmentation mechanism, as well as the overall architectural approach to fragmentation, are different in IPv4 and IPv6.
- In IPv4, routers do the fragmentation, whereas in IPv6, routers do not fragment, but drop the packets that are larger than the MTU size. Though the header formats are different for IPv4 and IPv6, similar fields are used for fragmentation, so the algorithm can be reused for fragmentation and reassembly.
- IP fragmentation can cause excessive retransmissions when fragments encounter packet loss and reliable protocols such as TCP must retransmit all of the fragments in order to recover from the loss of a single fragment.
- Thus senders typically use two approaches to decide the size of IP datagrams to send over the network.
- The first is for the sending host to send an IP datagram of size equal to the MTU of the first hop of the source destination pair.
- The second is to run the "Path MTU discovery" algorithm, to determine the path MTU between two IP hosts, so that IP fragmentation can be avoided.
- The flag field has three bits, one unused bit, one “don’t fragment”(DF) bit, and one “more fragment”(MF) bit.
- If DF bit is set to 1, it forces the router not to fragment the packet. If the packet length is greater than MTU, the router will discard the packet and send an error message to the source host.
- The MF bit tells the destination host whether or not more fragments follow. If there are more, the MF bit is set to 1; otherwise, it is set to 0.
- Fragment offset field identifies the location of a fragment in a packet.
Figure: Packet fragmentation
Deficiencies of IP
· Lack of error control, flow control and congestion control
· Lack of assistance mechanisms
What happens if something goes wrong?
· If a router must discard a datagram because it can not find a router to the final destination
· The time-to-leave field has a zero value
· If the final destination host must discard all fragments of a datagram because it has not received all fragments within a pre-determined time limit
IP has no built in mechanisms to notify the original hosts, in erroneous situations
IP also lacks a mechanism for host and management queries
• A host wants to know whether a router or another host is active
• Sometimes network manager needs information from another host or router
Internet Control Message Protocol [ICMP] is companion to IP, designed to compensate these deficiencies
· ICMP is a network layer protocol
· Its messages are encapsulated inside IP datagrams before going to lower layer
· Ping and Traceroute uses ICMP messages,
ICMP Messages
1) Error Reporting Messages
2) Query Messages
1) Error Reporting
· Destination unreachable
· Source quench
· Time exceeded
· Parameters problems
· Redirection
ICMP messages [Error reporting]
1. Destination unreachable
When the subnet or a router can not locate the destination
Or
When a packet with DF bit, can not be delivered because a ‘small-packet’ network stands in the way
2. Time exceeded
When a packet is dropped because its counter has reached zero. This event is a symptom that packets are looping enormous congestion or the time values are being set too low.
3. Parameter problem
Indicates that an illegal value has been detected in the header field
Indicates a bug in the sending host’s IP software Or Possibly in the software of a router transited.
4. Source quench
To throttle hosts that send too many packets, When a host receives this message, it slows down sending packets
5. Redirect
Is used when a router notices that a packet seems to be routed wrong
It is used by the router to tell the sending host about the probable error.
2) Query Messages
· Echo request and reply
· Time-stamp request and reply
· Address mask request and reply
1. ECHO & ECHO Reply
To see if a given destination is reachable and alive, upon receipt of ECHO message, the destination is expected to send an ECHO REPLY message back.
2. Time stamp & Time stamp reply
Similar to ECHO queries, except that the arrival time of the message and departure time of the reply are recorded in the reply.
This facility is used to measure network performance.
1) Announce network errors: Such as host or Entire portion of the network being unreachable, due to some type of failure. A TCP or UDP packet directed at a port number with no receiver attached is also reported via ICMP.
2) Announce network congestion: When a router begins buffering too many packets, due to an inability to transmit them as fast as they are being received, it will generate ICMP Source Quench messages. Directed at the sender, these
messages should cause the rate of packet transmission to be slowed.
3) Assist Troubleshooting: ICMP supports an Echo function, which just sends a packet on a round--trip between two hosts. Ping, a common network management tool, is based on this feature. Ping will transmit a series of packets,
measuring average round—trip times and computing loss percentages.
4) Announce Timeouts: If an IP packet's TTL field drops to zero, the router discarding the packet will often generate an ICMP packet announcing this fact.
Comments
Post a Comment