18BCT41 – COMPUTER NETWORKS
Prepared by:
Ms. K.Sathya
AP/CT-UG
Kongu Engineering College
Network Layer
INTERNETWORKING
Internetworking, connecting networks together to make an internetwork or an internet.
An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device to the Internet.
The address space of IPv4 is 232 .
Network layer in an internetwork
Finding the classes in binary and dotted-decimal notation
Default masks for classful addressing
Dotted-decimal notation and binary notation for an IPv4 address
Change the following IPv4 addresses from binary notation to dotted-decimal notation.
Example
Solution
We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add dots for separation.
Change the following IPv4 addresses from dotted-decimal notation to binary notation.
Example
Solution
We replace each decimal number with its binary equivalent (see Appendix B).
Position of IPv4 in TCP/IP protocol suite
IPv4 datagram format
Encapsulation of a small datagram in an Ethernet frame
Protocol field and encapsulated data
Fragmentation example
Detailed fragmentation example
A packet has arrived with an M bit value of 1. Is this the first fragment, the last fragment, or a middle fragment? Do we know if the packet was fragmented?
Solution
If the M bit is 1, it means that there is at least one more fragment. This fragment can be the first one or a middle one, but not the last one. We don’t know if it is the first one or a middle one; we need more information (the value of the fragmentation offset).
Example
A packet has arrived with an M bit value of 1 and a fragmentation offset value of 0. Is this the first fragment, the last fragment, or a middle fragment?
Solution
Because the M bit is 1, it is either the first fragment or a middle one. Because the offset value is 0, it is the first fragment.
Example
Classful addressing, which is almost
obsolete, is replaced with classless
addressing.
Classful Address
In classful addressing, a large part of the available addresses were wasted.
Another way to find the first address, the last address, and the number of addresses is to represent the mask as a 32-bit binary (or 8-digit hexadecimal) number. This is particularly useful when we are writing a program to find these pieces of information. In Example /28 can be represented as
11111111 11111111 11111111 11110000
Find
a. The first address
b. The last address
c. The number of addresses.
Example
Solution
a. The first address can be found by ANDing the given� addresses with the mask. ANDing here is done bit by� bit. The result of ANDing 2 bits is 1 if both bits are 1s;� the result is 0 otherwise.
Example
b. The last address can be found by ORing the given� addresses with the complement of the mask. ORing� here is done bit by bit. The result of ORing 2 bits is 0 if� both bits are 0s; the result is 1 otherwise. The� complement of a number is found by changing each 1� to 0 and each 0 to 1.
Example
A frame in a character-oriented protocol
A NAT implementation
The first address in a block is �normally not assigned to any device; �it is used as the network address that represents the organization �to the rest of the world.
IPv6 ADDRESSES
Despite all short-term solutions, address depletion is still a long-term problem for the Internet. This and other problems in the IP protocol itself have been the motivation for IPv6.
An IPv6 address is 128 bits long
IPv6 datagram header and payload
Format of an IPv6 datagram
Comparison between IPv4 and IPv6 packet headers