Contributed by Souvik Official Website: http://www.aliencoders.com Facebook Page: https://www.facebook.com/aliencoders
What you will learn How internet addressing works Internet Addressing Role played by Routing and addressing ARP TCP/UDP IPv6 into the picture The Internet Protocol (IP) enables communications across a vast and heterogeneous collection of networks.
The Internet offers two basic communication services that operate on top of IP:
TCP Transmission control protocol i.e reliable stream service. UDP User datagram Protocol. The TCP header contains the port number of the client process and the well known port 80 for the HTTP server process.
The IP network address are the logical address because they are defined in terms of logical topology of the routers and the end systems.
Ethernet LAN frames contains physical address that identify the physical endpoints for the sender and the receiver.
The network interface layer is particularly concerned with the protocols that are used to access the intermediate networks.
At each gateway the network protocol is used to encapsulate the IP packet into a packet or frame of the underlying link.
The router must determine the next hop in the route to the destination and then encapsulate the IP packet or frame of the type of the next network or link IP Packet Total Length : With 16 bits , the max packet length = 65,535
Protocol TCP =6 ; UDP =17 ; ICMP = 1
Options : Security level , Route to be taken by the packet
Padding : To make the header field a multiple of 32 bit word.
Network I nternet Addressing Host An IP address is divided into 2 parts: a) network part 2) host part .
The part of a public IP address that identifies the network is internationally controlled by the Network Information Center (NIC) located in the Stanford Research Institute in California.
The part that identifies the host is controlled locally at a network level.
I nternet Addressing An Internet address is four octets (i.e. 32 bits) long.
The first few bits in the network part of the address helps interpret the address.These bits indicate the class of the address.
When a system wants to communicate over the internet they need to have a public address.
This public address has to be purchased from NIC in Stanford.
Address classes There are five Internet address classes. They are : Class A / B / C / D / E .
Class A addressing is used for very large networks, that is networks which will have a large number of hosts attached to them.
For class A the MSB is 0.
Each pure class A network can support (224-2) hosts. One address each being reserved for network address (all 0 ) and all one for broad cast.
Class A 24 bits Host ID The first bit is 0 and next 7 bits called the Net ID identifies the network . The next field contains the host ID, which identifies the particular host within the specified network.
In a class A address it's 24 bits long and therefore allows for almost 17 million hosts on a network.
For example 10.200.20.5 is a class A address
Class B Class B addressing is used for medium-sized networks.
If the first two bits in the address are 10, it's a class B address. 14 bits for network Ids and 16 bits for host Ids allowing about 16,000 networks and 64,000 hosts for each network.
The range of first octet of class B address is 128 191.i.e 128.0.0.0 to 191.255.0.0
Class C The next address class is class C, probably the most common network class. If the first 3 bits in the address are 110, the address is a class C address.
The net ID is 21 bits long and the host ID is 8 bits long, allowing about 21 million networks and 254 hosts per network.
The range of class C Network is 192.0.0.0 223.255.255.0
The 192.0.0.2555 is the broadcast address and 192.0.0.0 is the network address.
Class D Class D addressing is used for multicasting a number of hosts for applications like audio and video conferencing.
Class D networks have the first 4 bits in the network part = 1110.
The first octet ranges from 224 239.
All the addressees from 224.0.0.0 to 239.255.255.255 can be used as multicast address.
All students in Internet Class! A host ID that contains all 1s is meant to broadcast the packet to all hosts specified by the network.
If the network ID also contains all 1s the packet is broadcast on the local network.
A host ID that contains all 0s refers to the network specified by the network ID , rather than to a host.
A source may send all 0s in the source address while trying to find out the correct IP address. The machine is then identified by its MAC address. These are the IP address ranges reserved for private networks within organizations.
These addresses will not be allocated by NIC as public IP address for the internet.
There is no problem of clash because when a packet goes outside the organization the local IP address gets translated into into the public IP address purchased by the organizations. Private Addressing Class A: 10.0.0.0 to 10.255.255.255---- 1 Class A network Class B: 172.16.0.0 to 172.31.255.255 ---- 16 contiguous Class B networks Class C: 192.168.0.0 to 192.168.255.255--- 255 contiguous Class C networks These are IP address ranges reserved for private networks within organizations.
These addresses will not be allocated by NIC as public IP addresses for the Internet.
There is no problem of clash because when a packet goes outside the organization the local IP address gets translated into the public IP address purchased by the organization. Reserved and Available I P Addresses Class Address or Range Status A 0.0.0.0 1.0.0.0 through 126.0.0.0 127.0.0.0 Reserved Available Reserved B 128.0.0.0 128.1.0.0 through 191.254.0.0 191.255.0.0 Reserved Available Reserved C 192.0.0.0 192.0.1.0 through 223.255.254 223.255.255.0 Reserved Available Reserved D 224.0.0.0 through 239.255.255.255 Multicast group addresses E 240.0.0.0 through 255.255.255.254 255.255.255.255 Reserved Broadcast Subnet Addressing : To add another hierarchical level called the subnet .
The beauty of the subnet addressing scheme is that it is oblivious to the network outside the organization.
An organization has many LANs , each consisting of no more than 100 hosts.
7 bits for for host identification in a sub network and other 9 bits are used for identifying the subnetwork.
Packet with destination IP 150.100. 12.176 arrives
The subnet mask used is 11111111 11111111 11111111 10000000 = 255.255.255.128
The router performs the AND between the subnet mask and the IP and the subnet number becomes 10010110 01100100 00001100 10000000 : 150.100.12.128
This number is used to forward the packet to the correct subnetwork. I P Address Classes Exercise Address Class Network Host 10.2.1.1 128.63.2.100 201.222.5.64 192.6.141.2 130.113.64.16 256.241.201.10 IP Address Classes Exercise Answers Address Class Network Host 10.2.1.1 128.63.2.100 201.222.5.64 192.6.141.2 130.113.64.16 256.241.201.10 A B C C B Nonexistent 10.0.0.0 128.63.0.0 201.222.5.0 192.6.141.0 130.113.0.0 0.2.1.1 0.0.2.100 0.0.0.64 0.0.0.2 0.0.64.16 Subnet Mask 172 16 0 0 255 255 0 0 255 255 255 0 IP Address Default Subnet Mask 8-bit Subnet Mask Network Host Network Host Network Subnet Host Also written as /16 where 16 represents the number of 1s in the mask. Also written as /24 where 24 represents the number of 1s in the mask.
Subnet Mask with Subnets (cont.) Network Host 172.16.2.160 255.255.255.192 10101100 11111111 10101100 00010000 11111111 00010000 11111111 00000010 10100000 11000000 10000000 00000010 Subnet Network number extended by ten bits 16 172 2 128 Subnet Address 1 2 8
1 9 2
2 2 4
2 4 0
2 4 8
2 5 2
2 5 4
2 5 5
1 2 8
1 9 2
2 2 4
2 4 0
2 4 8
2 5 2
2 5 4
2 5 5
Subnet Mask Exercise Address Subnet Mask Class Subnet 172.16.2.10 10.6.24.20 10.30.36.12 255.255.255.0 255.255.240.0 255.255.255.0 Subnet Mask Exercise Answers Address Subnet Mask Class Subnet 172.16.2.10 10.6.24.20 10.30.36.12 255.255.255.0 255.255.240.0 255.255.255.0 B A A 172.16.2.0 10.6.16.0 10.30.36.0 Broadcast Addresses 172.16.1.0 172.16.2.0 172.16.3.0 172.16.4.0 172.16.3.255 (Directed broadcast) 255.255.255.255 (Local network broadcast) X 172.16.255.255 (All subnets broadcast) Addressing Summary Example 16 172 2 160 10101100 00010000 10100000 00000010 Host Mask Subnet Broadcast Last First 172.16.2.160 255.255.255.192 4 1 Addressing Summary Example 10101100 11111111 00010000 11111111 11111111 10100000 11000000 00000010 Host Mask Subnet Broadcast Last First 172.16.2.160 255.255.255.192 1 2 16 172 2 160 Addressing Summary Example 10101100 11111111 00010000 11111111 11111111 10100000 11000000 00000010 Host Mask Subnet Broadcast Last First 172.16.2.160 255.255.255.192 1 2 3 7 16 172 2 160 Addressing Summary Example 10101100 11111111 00010000 11111111 11111111 10100000 11000000 10000000 00000010 Host Mask Subnet Broadcast Last First 172.16.2.160 255.255.255.192 1 2 3 4 16 172 2 160 Addressing Summary Example 10101100 11111111 00010000 11111111 11111111 10100000 11000000 10000000 00000010 10111111 Host Mask Subnet Broadcast Last First 172.16.2.160 255.255.255.192 1 2 3 4 5 6 16 172 2 160 Addressing Summary Example 10101100 11111111 00010000 11111111 11111111 10100000 11000000 10000000 00000010 10111111 10000001 Host Mask Subnet Broadcast Last First 172.16.2.160 255.255.255.192 1 2 3 4 5 6 16 172 2 160 Addressing Summary Example 10101100 11111111 00010000 11111111 11111111 10100000 11000000 10000000 00000010 10111111 10000001 10111110 Host Mask Subnet Broadcast Last First 172.16.2.160 255.255.255.192 1 2 3 4 5 6 7 16 172 2 160 Addressing Summary Example 10101100 11111111 10101100 00010000 11111111 00010000 11111111 00000010 10100000 11000000 10000000 00000010 10101100 00010000 00000010 10111111 10101100 00010000 00000010 10000001 10101100 00010000 00000010 10111110 Host Mask Subnet Broadcast Last First 172.16.2.160 255.255.255.192 1 2 3 4 5 6 7 8 16 172 2 160 Routing Demonstration ARP 192.168.89.20 192.168.89.40 192.168.88.20 192.168.88.40 192.168.89.2 192.168.88.2 192.168.90.2 192.168.90.3 192.168.91.3 192.168.91.4 Router B Router C Router A Layer 2 Layer 2 Routing done by Host
Network Destination Netmask Gateway Interface 0.0.0.0 0.0.0.0 192.168.88.2 192.168.88.40 192.168.88.0 255.255.255.0 192.168.88.4 0 192.168.88.40 192.168.88.40 255.255.255.25 5 127.0.0.1 127.0.0.1 Let assume IP packet received by network layer of host have destination IP 192.168.88.20 and source IP: 192.168.88.40 192.168.88.20 AND 255.255.255.255 192.168.88.20 192.168.88.20 AND 255.255.255.0 192.168.88.0 Routing done by Host
Network Destination Netmask Gateway Interface 0.0.0.0 0.0.0.0 192.168.88.2 192.168.88.40 192.168.88.0 255.255.255.0 192.168.88.4 0 192.168.88.40 192.168.88.40 255.255.255.25 5 127.0.0.1 127.0.0.1 Let assume IP packet received by network layer of host have destination IP 192.168.89.4 and source IP: 192.168.88.40 192.168.89.4 AND 255.255.255.255 192.168.89.4 192.168.89.4 AND 255.255.255.0 192.168.89.0 192.168.89.4 AND 0.0.0.0 0.0.0.0
Network Destination Netmask Gateway Interface 0.0.0.0 0.0.0.0 192.168.90.3 192.168.90.2 192.168.88.0 255.255.255. 0 192.168.88.2 192.168.88.2 192.168.89.0 255.255.255. 0 192.168.89.2 192.168.89.2 192.168.90.0 255.255.255. 0 192.168.90.2 192.168.90.2 192.168.91.0 255.255.255. 0 192.168.90.3 192.168.90.2 Let assume IP packet received by layer 3 have destination IP 192.168.89.4 and source IP: 192.168.88.40 192.168.89.4 AND 255.255.255.0 192.168.89.0 Routing Done Router A Network Destination Netmask Gateway Interface 0.0.0.0 0.0.0.0 192.168.91.4 192.168.91.3 192.168.88.0 255.255.255.0 192.168.90.2 192.168.90.3 192.168.89.0 255.255.255.0 192.168.90.2 192.168.90.3 192.168.90.0 255.255.255.0 192.168.90.3 192.168.90.3 192.168.91.0 255.255.255.0 192.168.91.3 192.168.91.3 Routing Done by Router B Let assume IP packet received by Router A have destination IP 192.168.92.5 and source IP: 192.168.88.40 192.168.92.5 AND 255.255.255.0 192.168.92.0 192.168.92.5 AND 0.0.0.0 0.0.0.0 Dynamic Routing Routing Protocol Interior Gateway Protocol Exterior Gateway Protocol Open Shortest Path First Routing Information Protocol Border Gateway Protocol Dijkstra Algorithm Bellman Ford Algorithm Link State Protocol Distance Vector Protocol Address Resolution Protocol The address resolution protocol (ARP) is used when one host wants to get the physical address of another host on the same network.
Address Resolution Protocol Ignored Ignored Address Resolution Protocol Address Resolution Fragmentation and Reassembly IPv6 USER DATAGRAM PROTOCOL