IP Network layer

Loose hierarchical structure of the Internet.

The transport layer (TCP or UDP) create chunks of data and use the services of the IP layer to send them to their destination. The IP layer is responsible for the routing and switching of datagrams through network. It is an unreliable, datagram network, so if you want it reliability is built-in to the transport layer. Fragmentation is done non-transparently, though an option exists to disallow fragmentation of a packet. Maximum data size is 64k bytes, but 1500 is more typical (to fit without fragmentation down Ethernet).

Frame format

Version IHL Type of service Total length Id Fragment offset TTL Protocol Checksum Src Addr Dst Addr
4 bits 4 bits 8 bits 16 bits 16 bits 16 bits 8 bits 8 bits 16 bits 32 bits 32 bits
allows for coexistence of multiple versions of IP protocol length of header in 32 bit words (min 5 bytes, options of up to 40 bytes) 3 bit priority, then Reliable, Delay, Throughput fields 
(usually ignored)
total length of packet (header + data), max is 65535 bytes used to identify a group of fragments all belonging to same frame used to identify fragments for later reassembly supposed to be a time-to-live counter in seconds, but in practice just counts hops; when 0 it is dropped designed to transport many possible transport protocols, this field identifies which covers only header, not a CRC, recomputed at each hop (at least the TTL field changes)
The frame format can be extended with up to 40 additional bytes of header options. This was to preserve flexibility for the future, experimentation. Some options that have been used

IP addresses

The DDN Internet was administered by the DDN Network Information Center, and they hand out addresses. This has now been given to a commercial entity, and the monopoly they have is being contested in court.

IP addresses are of two parts: network and host. Each machine on a network has a unique-in-the-world address. Routers have one address for each network they are attached to.

Five classes of addresses (A - E)


Class A networks Class B networks Class C networks Class D networks Class E networks Some IP addresses are special Private IP space

IP Routing

Fundamental thing: routing is done on the network portion of the address.

Basic actions for routing

  1. Examine first few bits of dest addr to determine class of address
  2. Remove host portion of address
  3. Lookup network address in routing table
  4. Send packet out corresponding interface
How many entries in each router's routing tables?
Too many if this simple scheme was used, since each router would need an entry for every network (100,000s?)
Solution: use a default route.
How to remove host portion (the mechanics)?
AND the dest address with a class-specific bit misc
 
address class network bitmask
A 255.0.0.0
B 255.255.0.0
C 255.255.255.0

Subnetting

Address crisis

Routing protocols

Two routing protocols are needed. The first is for routing within an AS. The second is for routing between ASs.

OSPF (Open Shortest Path First)

BGP (Border Gateway Protocol)