11/3 Mon

 

IP Address


Special addresses

 

Prefix

Suffix

Address Type

Purpose

All 0¡¯s

All 0¡¯s

This computer

Bootstrap

- Real address is not available

Network #

All 0¡¯s

Network

Used to refer to a network ( Network ID )

Ex) 128.10.0.0-> cs.purdue.edu network / class B,  128.10.3.0-> faculty network / class C

Network #

All 1¡¯s

Directed broadcast

Broadcast in a determined network

Ex) 128.10.3.255 -> broadcast address in faculty net.

    128.10.255.255 -> broadcast to all cs.purdue.edu subnet

All 1¡¯s

All 1¡¯s

Limited broadcast

Broadcast in local net

Ex) 255.255.255.255 -> broadcast local net

127

Any

Loopback

testing

Ex) 127.0.0.1 -> localhost

 


11/5 Wed

InternetPhone project

 

2 programs

1 – Directory Server

             - Dialog based

2 – phone program

             - Includes Directory Client, Ringer Client/Server, Play Server/Voice Client


IP Packets

 

Because the internet connects heterogeneous networks, a router will copy the packets arriving in one network and copying them in another.

 

To accommodate heterogeneity, an internet must define a hardware independent packet format.

 

IP Packet == IP Datagram

IP packets are the basic unit of communication in the internet


IP Packet Header

0      3

4      7

8     11

12    15

16    19

20    23

24    27

28    31

Ver

H Len

Service Type

Total Length

ID

Flags

Fragment Offset

Time To Live

Type

Header Checksum

Source IP

Destination IP

 

Version : 4 bit

-          current version is 4

-          new version is 6 ( still not widely used )

 

Header length : 4 bit

-          it is usually 20 bytes ( this number is in words of 4 bytes or 5 words )

-          if IP options are used, then header will be longer

 

Service type : 8 bit

-          priority ( usually ignored )

 

Total length : 16 bit

-          number of bytes in the packet including header

-          2^16 = 64KByte max

 

ID : 16 bit

-          monotonically increasing number different in each packet coming from the same source – 64k identifiers ( 0 ~ 64k )

-          it will start with random number and ( id++ % MAX_LEN )

 

Flag : 4 bit

-          do not fragment bit ( router should not fragment packets )

-          last fragment bit ( set to 1 if the packet is the last fragment )

 

Fragment offset : 12 bit

-          position of the packet in the original packet if it is fragmented

 

l       Reassembly is done at destination, not in the router.

n         Reassembly is not done in router because there is no guarantee that each packet will take same path ( some packets go through router ¡®A¡¯ and the other go through router ¡®B¡¯ )

l       Do not fragment bit is used to find PATH MTU

 

11/5 Wed

 

IP Packet Header

0      3

4      7

8     11

12    15

16    19

20    23

24    27

28    31

Ver

H Len

Service Type

Total Length

ID

Flags

Fragment Offset

Time To Live

Type

Header Checksum

Source IP

Destination IP

 

Time To Live ( TTL ) : 8 bit

-          Maximum number of seconds the packet should remain in the internet.

-          It is decremented by 1 every second the packet stays in the router queue

-          It is decremented by 1 every time the packet is routed by a router

-          If the TTL field reaches 0, the packet is discarded, and ICMP message ¡°Time expired¡± is sent to the source

-          Since the TTL field is 8 bits long, the maximum number of seconds, the packet can be in the internet will 255 seconds.

-          The packet can be routed 255 times max

-          This prevents a packet being forwarded forever.

 


IP Type : 8 bit

-          It tells the protocol on top of IP that is encapsulated in the data field : TCP/UDP/ICMP

 

Header checksum : 16 bit

-          Checksum of the IP header to check possible errors.

 

Source IP : 32 bit

-          IP address of source host

-          Initial source

 

Destination IP : 32 bit

-          IP address of destination host

-          Final destination

 

l       Source and destination do not change during the transit of the IP packet.

l       The header may have additional information known as ¡°IP options¡±

n         Example of IP options

n         record route

u       add the IP address of the router to the header every time the packet is routed

n         strict routing

u       loose follow the routing path indicated in the header

l       IP options are used in Network diagnostics

 

IP semantics

-          IP is connectionless

n         A datagram contains the destination and the identity of packet, the IP packet is ¡°self contained¡±, the packet contains everything it needs to reach its destination.

n         Each IP packet ( datagram ) is handled independently

-          Routers can change at any time

-          IP datagrams can be

n         Delayed

n         Duplicated

n         Delivered out of order

n         Lost

 

IP is a ¡°best effort¡± delivery protocol.

 

That means that the network hardware and protocol will do ¡°their best¡± to deliver packets but errors may occur.

 

The motivation for IP being so flexible is to accommodate all possible networks.