0% found this document useful (0 votes)
11 views

Unit 3

Uploaded by

ishwari.anjikar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Unit 3

Uploaded by

ishwari.anjikar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 109

Unit-3: Contents

 Ch.19: Network Layer: Logical Addressing - IPv4


and IPv6 addresses
 Ch.20: Network Layer: Internet Protocol-
Internetworking , IPv4 and IPv6
 Ch.21: Network Layer: Address Mapping- ARP,
RARP, BOOTP, and DHCP, ICMP and IGMP
 Ch.22: Network Layer: Delivery, Forwarding, and
Routing: Unicast and Multicast Routing Protocols.
 Ch.23: Transport Layer: Process-to-Process delivery -
UDP and TCP
1
TCP/IP and OSI model

2
Network layer

 Communication at this layer is host-to-host


(computer-to-computer)
 Logical or IP addresses are used
 Two types:
 IPv4: 32- bit
 IPv6: 128 -bit
Dotted-decimal and
Binary notation
Example 19.1

Change the following IPv4 addresses from binary


notation to dotted-decimal notation.

Solution
We replace each group of 8 bits with its equivalent
decimal number (see Appendix B) and add dots for
separation.
Example 19.2

Change the following IPv4 addresses from dotted-decimal


notation to binary notation.

Solution
We replace each decimal number with its binary
equivalent (see Appendix B).
Example 19.3

Find the error, if any, in the following IPv4 addresses.

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

 Classful (uses classes and obsolete)


 Classless (no classes)
Classful addressing
 Five classes: A, B, C, D, and E

 Class A: Large organizations


 Class B: Mid size organizations
 Class C: Small organizations
 Class D: Multicasting
 Class E: Reserved for future use.
 VIMP: A large part of the available addresses were wasted.
Example 19.4

Find the class of each address.


a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

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

 The mask is used to find the netid and the hostid.


 Slash notation or Classless Interdomain Routing (CIDR)
notation is denote the mask.
Subnetting
 The main purpose of subnetting is to help relieve network
congestion.
 A process of dividing a network into a subnetworks.
 If an organization was granted a large block in class A or B, it
could divide the addresses into several contiguous groups and
assign each group to smaller networks (called subnets) or, in
rare cases, share part of the addresses with neighbors.
 It increases the number of 1s in the mask.
Advantages:
 Minimizes the network traffic through decreasing the volume

of broadcasts.
 Increases addressing flexibility.

 Increases the number of allowed hosts in local area network.

 The network security can be readily employed between

subnets rather than employing it in the whole network.


 Subnets are easy to maintain and manage.

Disadvantages:
 However, it is quite expensive.

 It requires trained administrator to perform subnetting.

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

summarizing several routing information entries into a single


entry.
 It also increases the speed of routing table lookup.

 Provision for the router to isolate the topology changes from


the other routers.
 It also reduces the network traffic.

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.

 When merged, it lacks covering different areas.

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

Figure shows a block of addresses, in both binary and dotted-decimal


notation, granted to a small business that needs 16 addresses.

Check the restrictions:


1. The addresses are contiguous.
2. The number of addresses is a power of 2 (16 = 24).
3. First address is divisible by 16.
Mask
 A better way to define a block of addresses is to select any
address in the block and the mask.
 Mask is a 32-bit number: (any value from 0 to 32)
 n leftmost bits: 1s
 32 - n rightmost bits: 0s.
 It is very convenient to use: /n or CIDR notation.
 In IPv4 addressing:
 Definition of addresses: x.y.z.t /n
 x.y.z.t: addresses
 /n : mask.
Example 19.6

A block of addresses is granted to a small organization. We know that one of the


addresses is 205.16.37.39/28. What is the first address in the block?

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

Find the last address for the block in Example 19.6.

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

Find the number of addresses in Example 19.6.

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)

b. The last address can be found by ORing the given


addresses with the complement of the mask.
Example 19.9 (continued)

c. The number of addresses can be found by


complementing the mask, interpreting it as a decimal
number, and adding 1 to it.
Limitations of the IPv4
 Not enough addresses (or lack of address space) - 232
 Security is optional:
 Originally designed as an isolated military network
 Then adapted for public education and research
network
 Transition time (from IPv4 to IPv6)
 IPv5: is an experimental.
 Lack of quality of service support (QoS)
 Geographic limitations - since the Internet was
created in the USA, this country is also involved in
the distribution of IP addresses.
IPv6 ADDRESSES
 Motivation for IPv6.
 Accommodation for real-time audio and video transmission.
 Encryption and Authentication of data
Contents

 Ch.19: Network Layer: Logical Addressing - IPv4


and IPv6 addresses
 Ch.20: Network Layer: Internet Protocol-
Internetworking , IPv4 and IPv6
 Ch.21: Network Layer: Address Mapping- ARP,
RARP, BOOTP, and DHCP, ICMP and IGMP
 Ch.22: Network Layer: Delivery, Forwarding, and
Routing: Unicast and Multicast Routing Protocols
Ch.23: Transport Layer: Process-to-Process delivery -
UDP and TCP

33
INTERNETWORKING
(Links between two hosts)

Delivery of packets through the several links.


Network layer in an internetwork

The n/w layer is responsible for host-to-host delivery and for


routing the packets through the routers or switches.
Network layer at the source and destination

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

Switch or Router: Routing the packet using the routing table.


IPv4
 It is an unreliable and connectionless datagram protocol - a
best-effort delivery service.
 Best-effort delivery: No error and flow control (except for
error detection on the header).
 If reliability is important, IPv4 must be used along a reliable
protocol such as TCP.
 It is also a connectionless protocol for a packet-switching
network that uses the datagram approach.
 Each datagram is handled independently, and each datagram
can follow a different route to the destination.
 Datagrams may be corrupted, lost, or arrive out of order.
 Again, It relies on a higher-level protocol to take care of all
these problems.
IPv4 datagram format

 A datagram is a variable – length packet consisting of two parts: Header and


Data.
 Header: 20 to 60 bytes and carriers information essential for routing and
delivery. Header is of 4 bytes as defined by the TCP/IP .
Version (VER):
 It is a 4 – bit field.

 Defines the version of the IPv4 protocol.

 Currently version is 4.

 It tells the IPv4 software running in the processing machine.

 If the machine is using some other version of IPv4, the

datagram is discarded.
19.40
Header length (HLEN):
 It is a 4 – bit field.

 It defines the total length of the datagram header.

 It is required because the length of the header is variable

(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:

 Internet Engineering Task Force (IETF) has changed the


interpretation and name.
 Service type: Previously
 Differentiated services: Now
 Precedence is a 3-bit field and defines the priority of the
datagrams in issues such as congestion.
 TOS bits is a 4-bit field having a special meaning.
 Last bit is not used.
Table 20.2 Default types of service
Total length:
 It is a 16 – bit field.

 It defines the total length (header + data).

 Length of the data = total length – header length.

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.

 More efficient routing.

 Fragmentation only by host.

 More efficient packet processing

 Routers do not calculate header checksum (speed up)

 Built in security mechanism.

 Single control protocol

 Auto configuration

 Support for new services.

Disadvantages:
 Much harder to remember to IP addresses.

19.50
Unit-3: Contents

 Ch.19: Network Layer: Logical Addressing - IPv4


and IPv6 addresses
 Ch.20: Network Layer: Internet Protocol-
Internetworking , IPv4 and IPv6
 Ch.21: Network Layer: Address Mapping- ARP,
RARP, BOOTP, and DHCP, ICMP and IGMP
 Ch.22: Network Layer: Delivery, Forwarding, and
Routing: Unicast and Multicast Routing Protocols.
 Ch.23: Transport Layer: Process-to-Process delivery -
UDP and TCP
51
Address Mapping
 The delivery of a packet to a host or a router requires
two levels of addressing: logical and physical.
 Address mapping:
Physical address (48 bit MAC address) ↔ logical
address (or IP address)
 This can be done by using either static or dynamic
mapping.

19.52
Static Mapping:
 Physical address may change in following ways:

1. A node could change its NIC, resulting in a new physical


address.
2. In some LANs, such as local talk, the physical address
changes every time the computer is turned on.
3. A mobile computer can move from one physical n/w to
another, resulting in a change in its physical address.
 To implement these changes, the static mapping table must be

update periodically. This overhead could affect n/w


performance.
Dynamic Mapping:
 Each time a machine knows one of the two address (LA or

PA), it can use a protocol to find the other one.

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

 ICMP is a supporting protocol and is used by n/w

devices to send error messages and operational


information.

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

 Ch.19: Network Layer: Logical Addressing - IPv4


and IPv6 addresses
 Ch.20: Network Layer: Internet Protocol-
Internetworking , IPv4 and IPv6
 Ch.21: Network Layer: Address Mapping- ARP,
RARP, BOOTP, and DHCP, ICMP and IGMP
 Ch.22: Network Layer: Delivery, Forwarding, and
Routing: Unicast and Multicast Routing Protocols.
 Ch.23: Transport Layer: Process-to-Process delivery -
UDP and TCP
63
 Delivery, forwarding, and routing of IP packets to
their final destinations.
 Delivery: Way of handling a packet under the control
of the n/w layer.
 Forwarding: Way of delivering a packet to the next
station
 Routing: Routing tables help in forwarding a packet.

19.64
Delivery

19.65
Forwarding:
 Place the packet in its route to its destination.

 It requires a host or router to have a routing table.

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

 Experimental internet for troubleshooting

 Poor strategy

Dynamic Routing Table:


 Updated periodically by using one of the following:

 Routing Information Protocol (RIP)- distance vector protocol

 Open Shortest Path First (OSPF)-link state protocol

 Border Gateway Protocol (BGP)- path vector protocol

19.71
Popular routing protocols

22.72
Distance vector routing tables

In distance vector routing, each node shares its routing table


with its immediate neighbors periodically and when there is a
change.
22.73
Link State Routing
 It has different philosophy from that of distance
vector routing.
 Dijkstra’s algorithms is a popular and is used to find
the shortest path.
 The algorithms divides the nodes into two sets:
tentative and permanent.

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

In unicasting, the router forwards the received packet through


only one of its interfaces.
19.81
In multicasting, the router may forward the received packet
through several of its interfaces.
Unit-3: Contents

 Ch.19: Network Layer: Logical Addressing - IPv4


and IPv6 addresses
 Ch.20: Network Layer: Internet Protocol-
Internetworking , IPv4 and IPv6
 Ch.21: Network Layer: Address Mapping- ARP,
RARP, BOOTP, and DHCP, ICMP and IGMP
 Ch.22: Network Layer: Delivery, Forwarding, and
Routing: Unicast and Multicast Routing Protocols.
 Ch.23: Transport Layer: Process-to-Process
delivery - UDP and TCP
83
PROCESS -TO -PROCESS DELIVERY
 The transport layer is responsible for process-to-process
delivery—the delivery of a packet, part of a message, from one
process to another.

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

 It is suitable for a process that requires simple


request-response communication.
 It is suitable for a process with internal flow and error
control mechanisms.
 It is a suitable transport protocol for multicasting.
 It is used for management processes such as SNMP.
 It is used for some route updating protocols such as
RIP.

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

 First segment (Client): Use for synchronization of sequence numbers.


 Second segment (Server): SYN + ACK used for communication in other direction
and ACK for first segment.
 Third segment (Client): ACK purpose.
Data transfer

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

You might also like