Unit 3
Unit 3
2
Network layer
Solution
We replace each group of 8 bits with its equivalent
decimal number (see Appendix B) and add dots for
separation.
Example 19.2
Solution
We replace each decimal number with its binary
equivalent (see Appendix B).
Example 19.3
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
IP addresses
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
Netid and Hostid
Class A, B, or C is divided into netid and hostid
Not applied to Class D and E
19.11
Classes and Blocks
Classes and Blocks
0000 0000 0
0111 1111 127
1000 0000 128
1011 1111 191
Default Mask for classful addressing
of broadcasts.
Increases addressing flexibility.
Disadvantages:
However, it is quite expensive.
19.16
Supernetting
A process of combining small networks into a large network.
The time came when most of the class A and class B addresses were depleted;
however, there was still a huge demand for midsize blocks.
The size of a class C block with a maximum number of 256 addresses did not
satisfy the needs of most organizations.
Even a midsize organization needed more addresses. One solution was
supernetting.
An organization can apply for a set of class C blocks instead of just one.
It decreases the number of 1s in the mask.
Classless addressing eliminated the need for supernetting.
Advantages:
The size of the router memory table is minimized by
Disadvantages:
The combination of blocks should be made in power 2;
alternatively, if the three blocks are required, then there must
be assigned four blocks.
The whole network should exist in the same class.
19.18
19.19
Classless Addressing
It was designed and implemented:
More organizations can access to the Internet.
Technique:
There are no classes
Addresses are still granted in blocks.
Address Blocks
The size of block or range of addresses is varies based on the nature and size of
the entity.
An ISP may be given thousands or hundreds of thousands based on the number
of customers it may serve.
Three Restriction to simplify the handling of addresses:
1. The addresses in a block must be contiguous, one after another.
2. The number of addresses in a block must be a power of 2 (1, 2, 4, 8, ... ).
3. The first address must be evenly divisible by the number of addresses.
Example 19.5
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 00100000
or
205.16.37.32.
This is actually the block shown in Figure 19.3.
19.24
Example 19.7
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
This is actually the block shown in Figure 19.3.
Example 19.8
Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
Example 19.9
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 19.5 the /28 can
be represented as
11111111 11111111 11111111 11110000
(twenty-eight 1s and four 0s).
Find
a. The first address
b. The last address
c. The number of addresses.
Example 19.9 (continued)
Solution
a. The first address can be found by ANDing the given
addresses with the mask.
205.16.37.39/28
Example 19.9 (continued)
33
INTERNETWORKING
(Links between two hosts)
Source: Destination:
Creating a packet with logical address of Address verification.
source and destination. Reassemble the packet.
Checking the routing information from the
routing table.
Packet is fragmented if it is too large.
Network layer at the router
Currently version is 4.
datagram is discarded.
19.40
Header length (HLEN):
It is a 4 – bit field.
(between 20 to 60 bytes).
When no options, the header length is 20 bytes and its value is 5
(0101) {5 x 4 = 20}.
When the option field is maximum, the value is 15 (1111){15 x 4 =
60}.
19.41
Services:
19.44
Identification, Flags and Fragmentation offset:- used
in Fragmentation
Fragmentation: It divides a packet into smaller units
to accommodate a protocol’s Maximum Transfer Unit
(MTU)
Time to Live: A datagram has a limited lifetime in its travel
through an internet.
Timestamp: 16
R1 (15) R2 (14) ---- Rn (0)
Protocol
Checksum: To detect corruption in the header.
Source IP address: 32-bit
Destination IP address: 32-bit
Options: Network testing and Debugging
Features IPv4 IPv6
Address space 32 – bit (or 4 bytes) 128 – bit (or 16 bytes)
Length of header 20 bytes 40 bytes
IPSec support Optional Required
Identification to the No (lack of QoS Yes (Efficient QoS
packet flow handling) handling)
Fragmentation Host and Routers Hosts only
IP Configuration Manually or DHCP Auto configuration or
DHCP
Unicast, Multicast and Unitcast All three and any cast
Broadcast
19.49
Advantages of IPv6:
More efficient address space allocation.
Auto configuration
Disadvantages:
Much harder to remember to IP addresses.
19.50
Unit-3: Contents
19.52
Static Mapping:
Physical address may change in following ways:
19.53
Address Resolution Protocol (ARP)
ARP: Obtaining PA from Logical or IP address.
Reverse ARP : Obtaining LA from PA
ARP Packet:
PA and LA of sender
LA of the receiver.
19.54
ARP Packet
19.55
Hardware type: 16-bit field, type of n/w on which ARP is running.
Ethernet: type 1.
Protocol type: 16-bit field, defining protocol. 0800: IPv4 protocol.
Hardware length: 8-bit field, defining the length of the physical
address in bytes. Ethernet: 6
Protocol length: 8-bit field, defining the length of the logical address
in bytes. 4: IPv4 protocol.
Operation: 16-bit field defining the type of packet. ARP request (1)
and ARP reply (2).
19.56
Encapsulation of ARP packet
21.57
Four cases using ARP
21.58
Internet Control Message Protocol (ICMP)
Two deficiencies of IP:
1. No error-reporting (lack of error control)
2. No error-correcting mechanism (lack of assistance
mechanism)
Solution: ICMP
19.59
Types of Messages
1. Error-reporting
It report problems that a router or a host (destination) may encounter when
it processes an IP packet.
Destination unreachable: Packet could not be delivered.
Source quench: Flow control/slow down the transmission.
Time exceeded: Time to live field hit 0.
Parameter problems: Invalid header field.
Redirection: Teach a router about geography.
19.60
Types of Messages
2. Query
It occurs in pairs, help a host or a network manager to get specific
information from a router or another host.
Echo request and reply: Diagnostic purposes.
Timestamp request and reply: RTT determination.
Address-mask request and reply: Necessary mask find a near by router.
Router solicitation and advertisement: Message is sent from a host to any
routers on the LAN to request that they advertise their process on the
network.
19.61
Internet Group Management Protocol (IGMP)
The IP protocol can be involved in two types of
communication: unicasting and multicasting.
IGMP is one of the necessary, but not sufficient, protocols that
is involved in multicasting.
It is an integral part of the IP multicast.
1 R Current active
2 R Multicast groups
3 H Host want to join group
4 H Host want to leave the group
19.62
Unit-3: Contents
19.64
Delivery
19.65
Forwarding:
Place the packet in its route to its destination.
Forwarding techniques:
1. Next-Hop Vs Route method
2. Network-specific Vs Host-Specific method
3. Default method
19.66
Route method versus next-hop method
22.67
Host-specific versus network-specific method
22.68
Default method
22.69
Simplified forwarding module in classless address
22.70
Routing Table
A host or a router has a routing table with an entry for each
destination to route IP packets.
A routing protocol is a combination of rules and procedures that lets
routers in the Internet inform each other of changes.
Static Routing Table:
Information entered manually.
Small internet
Poor strategy
19.71
Popular routing protocols
22.72
Distance vector routing tables
19.74
Concept of link state routing
22.75
Link state knowledge
22.76
Dijkstra algorithm
22.77
Example of formation of shortest path tree
22.78
Node A = 1
Node B = 2
Node C = 3
Node D = 4
Node E = 5
19.79
Routing table for node A
Node A = 1
Node B = 2
Node C = 3
Node D = 4
Node E = 5
19.80
MULTICAST ROUTING PROTOCOLS
19.84
Port numbers
23.85
IP addresses versus port numbers
23.86
Socket address
23.87
Multiplexing and Demultiplexing
23.88
Position of UDP, TCP, and SCTP in TCP/IP suite
23.89
Connectionless Connection-oriented
No need for connection establishment 1. Connection is established first
or release between source and receiver.
2. Date transfer
3. Connection is released
Reliable Unreliable
Flow, error and congestion control - No flow, error and congestion control
Yes
19.90
USER DATAGRAM PROTOCOL (UDP)
It is called a connectionless, unreliable transport
protocol.
It does not add anything to the services of IP except
to provide process-to-process communication instead
of host-to-host communication.
UDP Features:
o Process – to –process communication
o Uses Port number
o Connection less service
o Unreliable: It does not use flow, error, and congestion
control
19.91
Well-known ports used with UDP
23.92
User datagram format
23.93
Use of UDP
19.94
Transmission Control Protocol (TCP)
It is a connection-oriented and reliable protocol.
It is a full-duplex (data in both directions at the same
time) and most widely used protocol.
TCP Features :
o Process – to – process communication
o Port numbers are used
o Numbering system (to keep track of segments that are
received/transmitted) – Byte, Sequence and ACK
number
o Reliable: It uses flow, error, and congestion control.
19.95
Well-known ports used by TCP
23.96
Stream delivery
23.97
Sending and receiving buffers
23.98
TCP segments
23.99
Connection-Oriented Service:
1. The two TCPs establish a connection between them.
2. Data are exchanged in both directions.
3. The connection is terminated.
Numbering System:
Each segment has a sequence and ACK number.
The bytes of date are numbered.
Sequence number for each segment (Data + control
information: Piggybacking)
19.100
TCP segment format
23.101
Sequence number: It is a 32 bit field, used for assigning the number to
byte of data. During the connection establishment, each party uses a
random number generator to create an initial sequence number (ISN),
which is usually different in each direction.
ACK number: It is 32 bit field defines the byte number that the receiver of
the segment is expecting to receiver fro the other party. N+1.
Header length: It is 4 bit field indicates the number of 4 byte words. The
length is in between 20 to 60 bytes.
Reserved: It is a 6 bit field reserved for future use.
19.102
Control field
23.103
Window size: It is a 16 bit field, used to define the size of
window, in bytes that the other party must maintain.
Checksum: It is a 16 bit field defines the checksum.
Urgent pointer: It is a 16 bit field, which is valid only if the
urgent flag is set, is used when the segment contains urgent
data.
Options: There can be up to 40 bytes of optional information.
19.104
Connection establishment using three-way handshaking
23.106
Connection termination using three-way handshaking
23.107
Parameters UDP TCP
Description Simple, High speed, low Full-featured, Reliable data
functionality transfer
Connection setup Connectionless Connection-oriented
Data sent Message-based date is sent Stream-based date is sent
Reliability Unreliable (No ACK) Reliable (Yes ACK)
Retransmission Not performed Data is lost- Retransmission
Flow control None Sliding window control
Overhead Very low Higher than UDP
Transmission Very high Lower than UDP
speed
Applications DNS, BOOTP, DHCP, FTP, Telnet, SMTP, DNS,
SNMP HTTP
19.108
Stream Control Transmission Protocol (SCTP)
It is a new reliable, message-oriented transport layer protocol.
SCTP, however, is mostly designed for Internet applications
that have recently been introduced.
These new applications need a more sophisticated service than
TCP can provide.
Examples: ISDN over IP, Telephony signaling, Media
gateway control, and IP telephony
It provides enhanced performance and reliability.
It combines the best features of UDP and TCP
Features: Data lost, data duplicate, out-of-order data, flow and
congestion control
19.109