Oct 30, Nov 1, 3
Internet Protocols
- Layering used with TCP/IP

- This layering represents the Internet more closer than the ISO-7 layer model
- Physical layer- basic network hardware
- Network Interface - media access (MAC) format and addressing
- Internet Layer - facilitates to send packets across the Internet using multiple routers
- Transport Layer - transport of data from one application to another
- Application Layer- user program
Layering principle - Software implementing layer N at the destination receives exactly the message sent by software implementing layer N at the source.

Internet Protocols
- Layer 3:
Defines the Internet addressing
packet format
routing
- IP addressing:
32 bits - 2^32 possible addresses = 4 billion
independent of hardware addressing
abstract
unique value for each host
one IP address belongs to only one host
some hosts (routers) may have more than one IP address
Important: An IP address identifies a connection between a computer and a network. A computer with multiple network connections (e.g. routers must be assigned one IP address for each connection).

>host cisco1 - gives all IP addresses of cisco1
>ypcat hosts - gives all IP addresses used in CS department
>ypcat hosts | grep cisco1 - all IP addresses cisco1
>ypcat hosts | grep 128.10.3
- IP address:
Divided in two parts
Prefix - identifies the network
Suffix - identifies the host
- A global authority assigns a unique prefix for a network
- A local administrator assigns a unique for the host

- Classes of addresses
Class A
7 bits for the network = 128 networks
24 bits for the host = 16 M. hosts
Class B
2^14 networks = 16 000 networks
2^16 hosts = 64 000 hosts

Class C
21 bits for the network
8 bits for the hosts = 256 hosts
Class D
Class E
- Dotted decimal notation:
shorthand for IP address
each object is represented by decimal and separated by dots
IP address d.d.d.d - each digit is in the range 0 - 255
This is not the same as DNS (Domain Name Service) like mentor.cc.purdue.edu
- What class is the address 129.52.6.0 ?
129 - represents 1000 0001 in binary
it is Class B
Net # = 129.52.0.0
Host # = 6.0
- What class is the address 128.10.2.3 ?
129 - represents 1000 0000 in binary
it is Class B
Net # = 128.10.0.0
Host # = 2.3
- What class is the address 192.5.48.3 ?
192 - represents 1100 0000 in binary
it is Class C
Net # = 192.5.48.0
Host # = 3
- What class is the address 10.2.0.32 ?
10 - represents 0000 1010 in binary
it is Class A
Net # = 10.0.0.0
Host # = 2.0.32
Class A addresses are for large networks.
Class B addresses are for medium networks.
Class C are for small networks.
For each class we can represent the net portion as 1's and the host portion as 0's. This is called network mask.
| Class | Network Mask |
| A | 255.0.0.0 |
| B | 255.255.0.0 |
| C | 255.255.255.0 |
The net # = IPaddress & Network mask
10.2.0.32 & 255.0.0.0 = 10.0.0.0
| Net # | Host # | Meaning | When to use |
| all 0's | all 0's | this host | bootstraping (IP address is not available) |
| net # | all 0's | network # | when you refer to a network |
| net # | all 1's | directed broadcast | applications that need broadcast |
| all 1's | all 1's | broadcast in all attached networks (limited broadcast) | apps. that need broadcast |
| 127 | any | loopback | the same computer |
IP Packets
- IP runs on heterogeneous networks
- A router that connects two networks with different kind of hardware cannot copy the packet as it is and place it in the other network.

- IP packets were created to run on basically any kind of network hardware.
- A router will copy only the IP packet and place it in a new hardware frame when routing. The old frame is discarded.
- There is an RFC for almost every network hardware that tells you how to implement IP on that hardware - IP on Ethernet, token ring, serial line, ATM.

H. LEN - header length
Serv. - priority
IP source, ID, offset - fragmentation reassembly
max length IP packet = 64 K bytes
max Ethernet packet = 1500
MTU - maximum transfer unit
- IP packets may need to be fragmented if the packet is longer than the MTU
- Routers may need to fragment IP packets. ID and offset are used for reassembly.
- Reassembly is done at the destination. This is because packets may follow different paths and it would be impossible to do reassembly in the routers.
- Time to leave - time the packet has been in the Internet (including routers). Max is 255 sec. After 255 secs. the packet is discarded. By default a router will decrement the TTL field by one when the packet is routed. This prevents the possibility of a packet circulating forever due to a routing loop.
- ID needs to be recycled after 64K packets. The TTL sets a limit of when an old ID is still valid.
- IP options - optional , used for recording a route
IP Routing
- Internet is made of hosts, networks, and routers.
- Routers - a piece of hardware or computer that performs IP routing.
Computer with a specialized software - UNIX BSD (Berkeley Standard Distribution) includes a program called "routed' that is the router that can be run to use a host as a router. The host needs to have more than one network interface - two connected networks. Routed was substituted by "gated" (www.gated.org)