Search This Blog

Wednesday, 13 August 2014

Internet Protocol (IP)

Simple Internetworking

Internetwork refer to an arbitrary collection of networks interconnected to provide some sort of host to host packet delivery service.

An internetwork is often referred to as a “network of networks” because it is made up of lots of smaller networks. we see Ethernets, an FDDI ring, and a point-to-point link. Each of these is a single-technology network. The nodes that interconnect the networks are called routers. They are also sometimes called gateways, but since this term has several other connotations, we restrict our usage to router.

Internet Protocol

The Internet Protocol is the key tool used today to build scalable, heterogeneous internetworks. It was originally known as the Kahn-Cerf protocol after its inventors. One way to think of IP is that it runs on all the nodes (both hosts and routers) in a collection of networks and defines the infrastructure that allows these nodes and networks to function as a single logical internetwork.

Service Model

The IP service model can be thought of as having two parts: an addressing scheme, which provides a way to identify all hosts in the internetwork, and a datagram (connectionless) model of data delivery. This service model is sometimes called best effort because, although IP makes every effort to deliver datagrams, it makes no guarantees.

Datagram Delivery

The IP datagram is fundamental to the Internet Protocol. A datagram is a type of packet that happens to be sent in a connectionless manner over a network. Every datagram carries enough information to let the network forward the packet to its correct destination;The “best-effort” part means that if something goes wrong and the packet gets lost, corrupted, misdelivered, or in any way fails to reach its intended destination, the network does nothing—it made its best effort, and that is all it has to do. It does not make any attempt to recover from the failure. This is sometimes called an unreliable service.

Best-effort, connectionless service is about the simplest service you could ask for from an internetwork, and this is a great strength. For example, if you provide best effort service over a network that provides a reliable service, then that’s fine—you end up with a best-effort service that just happens to always deliver the packets. If, on the other hand, you had a reliable service model over an unreliable network

Packet Format

Version: Version no. of Internet Protocol used (e.g. IPv4)


Hlen: specifies the length of the header in 32-bit words. When there are no options, which is most of the time, the header is 5 words (20 bytes) long.

TOS: The basic function of TOS is to allow packets to be treated differently based on application needs.


Length: The length includes everything in the datagram – both header and the data, the maximum length is 65,535 bytes.


Identification : The identification field is needed to allow the destination host to determine which datagram a newly arrived fragment belongs to. All the fragments of a datagram contain the same identification value.


Flags: The flags field is of 3-bits, one is unused and two 1-bit fields are DF, MF.

DF means Don’t Fragment , its an order to the router not to fragment the datagram because the receiver is incapable of putting the pieces back to gether again.

MF stands for More Fragments. All fragment except the last one have this bit set. It is needed to know when all fragments of a datagram have arrived.


Offset:The Fragment offset tells where in the current datagram this fragment belongs. All fragments except the last one in a datagram must be a multiple of 8 bytes, the elementary fragment unit. Since 13 bits are provided, there is a maximum of 8192 fragments per datagram, giving a maximum datagram length of 65,536 bytes, one more than the Total length field.


Time to live: The Time to live field is a counter used to limit packet lifetimes. It is supposed to count time in seconds, allowing a maximum lifetime of 255 sec. It must be decremented on each hop and is supposed to be decremented multiple times when queued for a long time in a router. In
practice, it just counts hops. When it hits zero, the packet is discarded and a warning packet is sent back to the source host.
Protocol: When the network layer has assembled a complete datagram, it needs to know what to do with it. The Protocol field tells it which transport process to give it to. TCP is one possibility, but so are UDP and some others.
Checksum: The Header checksum verifies the header only. Such a checksum is useful for detecting errors generated by bad memory words inside a router.

Source address and Destination address: The Source address and Destination address indicate the network number and host number.


Option Description
Security Specifies how secret the datagram is
Strict source routing Gives the complete path to be followed
Loose source routing Gives a list of router not to be missed
Record route Makes each router append its IP address
Timestamp Makes each router append its address and timestamp


IP Addresses

Every host and router on the Internet has an IP address, which encodes its network number and host number. The combination is unique: in principle, no two machines on the Internet have the same IP address. All IP addresses are 32 bits long and are used in the Source address and Destination address fields of IP packets. It is important to note that an IP address does not actually refer to a host. It really refers to a network interface, so if a host is on two networks, it must have two IP addresses. However, in practice, most hosts are on one network and thus have one IP address.

IP addresses were divided into the five categories.This allocation has come to be called classful addressing.



The class A, B, C, and D formats allow for up to 128 networks with 16 million hosts each, 16,384 networks with up to 64K hosts, and 2 million networks (e.g., LANs) with up to 256 hosts each (although a few of these are special). Also supported is multicast, in which a datagram is directed to multiple hosts. Addresses beginning with 1111 are reserved for future use. Over 500,000 networks are now connected to the Internet, and the number grows every year. Network numbers are managed by a nonprofit corporation called ICANN (Internet Corporation for Assigned Names and Numbers) to avoid conflicts.

Datagram Forwarding in IP

IP routers forward datagrams in an internetwork. That forwarding is the process of taking a packet from an input and sending it out on the appropriate output, while routing is the process of building up the tables that allow the correct output for a packet to be determined.

The main points to bear in mind as we discuss the forwarding of IP datagrams are the following:

  • Every IP datagram contains the IP address of the destination host. 
  • The “network part” of an IP address uniquely identifies a single physical network that is part of the larger Internet.
  • All hosts and routers that share the same network part of their address are connected to the same physical network and can thus communicate with each other by sending frames over that network.
  • Every physical network that is part of the Internet has at least one router that,by definition, is also connected to at least one other physical network; this router can exchange packets with hosts or routers on either network.

Forwarding Strategy: 

  • every datagram contains destination's address
  • if directly connected to destination network, then forward to host
  • if not directly connected to destination network, then forward to some router
  • forwarding table maps network number into next hop
  • each host has a default router
  • each router maintains a forwarding table
Datagram forwarding algorithm

if (NetworkNum of destination = NetworkNum of one of my interfaces) then
deliver packet to destination over that interface
else
if (NetworkNum of destination is in my forwarding table) then
deliver packet to NextHop router
else
deliver packet to default router

For a host with only one interface and only a default router in its forwarding table, this simplifies to

if (NetworkNum of destination = my NetworkNum) then
deliver packet to destination directly
else
deliver packet to default router

No comments:

Post a Comment