0% found this document useful (0 votes)
9 views17 pages

Unit 3

Uploaded by

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

Unit 3

Uploaded by

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

CS3591- COMPUTER NETWORKS

UNIT III NETWORK LAYER 10


3.1 Switching:
3.1.1 Packet Switching
3.2 Internet protocol
3.2.1 IPV4
3.2.2 IP Addressing
3.3 Subnetting
3.4 IPV6
3.5 ARP
3.6 RARP
3.7 ICMP
3.8 DHCP

3.1 Switching
 The technique of transferring the information from one computer network to
another network is known as switching.
 Switching in a computer network is achieved by using switches.
 A switch is a small hardware device which is used to join multiple computers
together with one local area network (LAN).
 Switches are devices capable of creating temporary connections between two or more
devices linked to the switch.
 Switches are used to forward the packets based on MAC addresses.
 A Switch is used to transfer the data only to the device that has been addressed. It
verifies the destination address to route the packet appropriately.
 It is operated in full duplex mode.

Types of Switching Techniques

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

PACKET SWITCHING
 The packet switching is a switching technique in which the message is sent in one
go, but it is divided into smaller pieces, and they are sent individually.
 The message splits into smaller pieces known as packets and packets are given a
unique number to identify their order at the receiving end.
 Every packet contains some information in its headers such as source address,
destination address and sequence number.
 Packets will travel across the network, taking the shortest path as possible.
 All the packets are reassembled at the receiving end in correct order.
 If any packet is missing or corrupted, then the message will be sent to resend the
message.
 If the correct order of the packets is reached, then the acknowledgment message will
be sent.

Advantages of Packet Switching:


 Cost-effective: In packet switching technique, switching devices do not require
massive secondary storage to store the packets, so cost is minimized to some extent.
Therefore, we can say that the packet switching technique is a cost- effective
technique.

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

 Reliable: If any node is busy, then the packets can be rerouted. This ensures that the
Packet Switching technique provides reliable communication.
 Efficient: Packet Switching is an efficient technique. It does not require any
established path prior to the transmission, and many users can use the same
communication channel simultaneously, hence makes use of available bandwidth very
efficiently.

Disadvantages of Packet Switching:


 Packet Switching technique cannot be implemented in those applications that
require low delay and high-quality services.
 The protocols used in a packet switching technique are very complex and
requires high implementation cost.
 If the network is overloaded or corrupted, then it requires retransmission of lost
packets. It can also lead to the loss of critical information if errors are nor recovered.

APPROACHES OF PACKET SWITCHING

There are two approaches to Packet Switching:


1. Datagram Packet switching
2. Virtual Circuit Switching

Datagram Packet switching


 It is a packet switching technology in which packet is known as a datagram, is
considered as an independent entity.
 Each packet contains the information about the destination and switch uses this
information to forward the packet to the correct destination.
 The packets are reassembled at the receiving end in correct order.
 In Datagram Packet Switching technique, the path is not fixed.
 Intermediate nodes take the routing decisions to forward the packets.
 Datagram Packet Switching is also known as connectionless switching.
 There are no setup or teardown phases.
 Each packet is treated the same by a switch regardless of its source or
destination.

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

Virtual Circuit Switching


 Virtual Circuit Switching is also known as connection-oriented switching.
 In the case of Virtual circuit switching, a virtual connection is established
before the messages are sent.
 Call request and call accept packets are used to establish the connection
between sender and receiver.
 In this case, the path is fixed for the duration of a logical connection.

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

PACKET SWITCHING

Virtual Circuit Switching Datagram Switching


Connection oriented Connection less
Ensures in order delivery Packets may be delivered out of order
No reordering is required Reordering is required
A dedicated path exists for data transfer No dedicated path exists for data
transfer
All the packets take the same path All the packets may not take the same
path
Resources are allocated on demand using 1st No resources are allocated
packet
Dynamic Bandwidth Dynamic bandwidth
Reliable Unreliable
Less overheads Higher overheads
Implemented at data link layer Implemented at network layer
Provides better efficiency than circuit switched Provides better efficiency than message
systems switched systems
Examples- X.25, Frame relay Example- Internet

INTERNET PROTOCOL
 Internet Protocols are a set of rules that governs the communication and exchange
of data over the internet.
 Both the sender and receiver should follow the same protocols in order to
communicate the data.
 The internet and many other data networks work by organizing data into small
pieces called packets.
 Each large data sent between two network devices is divided into smaller packets by
the underlying hardware and software.

IPV4

 Internet Protocol (IP) is the glue that holds the Internet together.
 Communication in the Internet:
1. Transport Layer takes a data stream and breaks them up into packets
(datagrams).
2. An IP datagram can be up to 64 KB but in practice they are about 1500
bytes.

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

3. Each IP datagram is routed through the Internet, possibly being


fragmented into smaller units as it goes.
4. When all the fragments get to the destination machine they are reassembled by
the network layer into the original datagram, which is handed to the transport
layer.
 The IP datagram header has a 20 byte fixed part and a variable length optional
part.

 Version (4-bits): indicates version of the protocol the datagram belongs to.

 IHL (4-bits): This field provides the length of the IP header. The length of the
header is represented in 32 bit words.
 Differentiated Services (8-bits): Corresponds to type of service. The first 3 bits of
this field are priority bits and are ignored as of today. The next 3 bits represent type of
service and the last 2 bits are unused.
 Total Length (16-bits): This represents the total IP datagram length in bytes
(header + data). Maximum size = 64 K or 65535 bytes.
 Identification (16 bits): Enables the destination host to determine which datagram a
newly arrived fragment belongs to. All fragments of a datagram contain the same
Identification value.
 Total Length (16-bits): This represents the total IP datagram length in bytes
(header + data). Maximum size = 64 K or 65535 bytes.
 Identification (16 bits): Enables the destination host to determine which datagram a
newly arrived fragment belongs to. All fragments of a datagram contain the same

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

Identification value.
 DF bit (1-bit): Don’t fragment (if destination is incapable of putting a datagram
fragments back together).
 MF (1-bit): More fragments. All fragments except the last one have this bit set to 1.
 Fragment Offset (13-bits): Indicates where in the current datagram this fragment
belongs (213 = 8192 fragments per datagram and 8192 * 8 = 65536 bytes. Each
fragment is a multiple of 8 bytes)
 TTL (8-bits): Used to limit packet lifetime. Maximum lifetime = 255 seconds.
In practice, it just counts hops. Default = 64 hops, which is decremented each
time the packet is forwarded.
 Protocol (8-bits wide): Tells IP which transport protocol to give the datagram
to (i.e. TCP or UDP).
 Header Checksum (16-bits): Verifies the header.
 Source and Destination Addresses (32-bits each): Indicate IP address (network
number and host number) of host.
 Options (maximum 40-bytes): Presences of options indicated by IHL field. Options
include record route, timestamp, and strict source routing.

IP Addressing

IPV4 ADDRESS SPACE

 IPv4 defines addresses has an address space.


 An address space is the total number of addresses used by the protocol.
 If a protocol uses b bits to define an address, the address space is 2 b

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

because each bit can have two different values (0 or 1).


 IPv4 uses 32-bit addresses, which means that the address space is 2 32 or
4,294,967,296 (more than four billion).
 4 billion devices could be connected to the Internet.

HIERARCHY IN IPV4 ADDRESSING

 In any communication network that involves delivery, the addressing system is


hierarchical.
 A 32-bit IPv4 address is also hierarchical, but divided only into two parts.
 The first part of the address, called the prefix, defines the network(Net ID); the
second part of the address, called the suffix, defines the node (Host ID).
 The prefix length is n bits and the suffix length is (32- n) bits.

 A prefix can be fixed length or variable length.


 The network identifier in the IPv4 was first designed as a fixed-length prefix.
 This scheme is referred to as classful addressing.
 The new scheme, which is referred to as classless addressing, uses a variable-
length network prefix.

CATEGORIES OF IPV4 ADDRESSING

 There are two broad categories of IPv4 Addressing techniques.


 They are
1. Classful Addressing

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

2. Classless Addressing

CLASSFUL ADDRESSING

 An IPv4 address is 32-bit long(4 bytes).


 An IPv4 address is divided into sub-classes

Classful Network Architecture

Class A
 In Class A, an IP address is assigned to those networks that contain a large
number of hosts.
 The network ID is 8 bits long.
 The host ID is 24 bits long.
 In Class A, the first bit in higher order bits of the first octet is always set to 0 and
the remaining 7 bits determine the network ID.
 The 24 bits determine the host ID in any network.
 The total number of networks in Class A = 2 7 = 128 network address
 The total number of hosts in Class A = 2 24 - 2 = 16,777,214 host address

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

Class B
 In Class B, an IP address is assigned to those networks that range from small- sized
to large-sized networks.
 The Network ID is 16 bits long.
 The Host ID is 16 bits long.
 In Class B, the higher order bits of the first octet is always set to 10, and the
remaining14 bits determine the network ID.
 The other 16 bits determine the Host ID.
 The total number of networks in Class B = 2 14 = 16384 network address
 The total number of hosts in Class B = 2 16 - 2 = 65534 host address

Class C
 In Class C, an IP address is assigned to only small-sized networks.
 The Network ID is 24 bits long.
 The host ID is 8 bits long.
 In Class C, the higher order bits of the first octet is always set to 110, and the
remaining 21 bits determine the network ID.
 The 8 bits of the host ID determine the host in a network.
 The total number of networks = 2 21 = 2097152 network address
 The total number of hosts = 2 8 - 2 = 254 host address

Class D
 In Class D, an IP address is reserved for multicast addresses.
 It does not possess subnetting.
 The higher order bits of the first octet is always set to 1110, and the remaining bits
determines the host ID in any network.

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

Class E
 In Class E, an IP address is used for the future use or for the research and
development purposes.
 It does not possess any subnetting.
 The higher order bits of the first octet is always set to 1111, and the remaining bits
determines the host ID in any network.

SUBNETTING
 In subnetting, a class A or class B block is divided into several subnets.
 Each subnet has a larger prefix length than the original network.
 For example, if a network in class A is divided into four subnets, each subnet has
a prefix of nsub = 10.
 At the same time, if all of the addresses in a network are not used,
subnetting allows the addresses to be divided among several organizations.

IPV6
FEATURES OF IPV6
 Better header format
 Allowance for extension
 Support for resource allocation
Additional Features
 Need to accommodate scalable routing and addressing
 Support for real-time services
 Security support
 Enhanced routing functionality, including support for mobile hosts

ADDRESS SPACE ALLOCATION OF IPV6


 IPv6 provides a 128-bit address space to handle up to 3.4 × 10 38 nodes.
 IPv6 uses classless addressing, but classification is based on MSBs.
 The address space is subdivided in various ways based on the leading bits.

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

ADDRESS NOTATION OF IPV6

 Standard representation of IPv6 address is x : x : x : x : x : x : x : x


where x is a 16-bit hexadecimal address separated by colon (:).
 For example, 47CD : 1234 : 4422 : ACO2 : 0022 : 1234 : A456 : 0124

PACKET FORMAT OF IPV6


 IPv6 base header is 40 bytes long.

 Version — specifies the IP version, i.e., 6.


 Traffic Class — defines priority of the packet with respect to traffic congestion.
It is either congestion-controlled or non- congestion controlled
 Flow Label — provides special handling for a particular flow of data. Router handles
different flows with the help of a flow table.
 Payload Len — gives length of the packet, excluding IPv6 header.

 Next Header — Options are specified as a header following IP header.


 NextHeader contains a pointer to optional headers.
 Hop Limit — Gives the TTL value of a packet.
 Source Address / Destination Address — 16-byte addresses of source and
destination host
 Auto Configuration — Auto or stateless configuration of IP address to hosts
without the need for a DHCP server, i.e., plug and play.
 Advanced Routing — Enhanced routing support for mobile hosts is provided.
 Additional Functions ― Enhanced routing functionality with support for mobile
hosts.

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

 Security ― Encryption and authentication options provide confidentiality and


integrity.
 Resource allocation ― Flow label enables the source to request special handling of
real-time audio and video packets

ADVANTAGES OF IPV6
 Address space ― IPv6 uses 128-bit address whereas IPv4 uses 32-bit address.
Hence IPv6 has huge address space whereas IPv4 faces address shortage problem.
 Header format ― Unlike IPv4, optional headers are separated from base header in
IPv6. Each router thus need not process unwanted addition information.
 Extensible ― Unassigned IPv6 addresses can accommodate needs of future
technologies.
Address Resolution Protocol (ARP) & Reverse Address Resolution
Protocol (RARP)

 The ARP and RARP protocols perform the translation between IP addresses
and MAC layer addresses
 We will discuss ARP for broadcast LANs, particularly Ethernet LANs

Ethernet MAC
IP address (32 AR address (48
bit)
P bit)
RAR
P
ARP Request:
Argon broadcasts an ARP request to all stations on the network: “What is the hardware
address of Router137?”

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

ARP Reply:
Router 137 responds with an ARP Reply which contains the hardware address

ICMP - INTERNET CONTROL MESSAGE PROTOCOL

ICMP is a network-layer protocol.


It is a companion to the IP protocol.
Internet Control Message Protocol (ICMP) defines a collection of error messages that are
sent back to the source host whenever a router or host is unable to process an IP datagram
successfully

ICMP MESSAGE TYPES

 ICMP messages are divided into two broad categories: error-reporting messages
and query messages.
The error-reporting messages report problems that a router or a host (destination) may
encounter when it processes an IP packet.
The query messages help a host or a network manager get specific information from a
router or another host

ICMP Error – Reporting Messages

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

Destination Unreachable―When a router cannot route a datagram, the datagram is


discarded and sends a destination unreachable message to source host.

Source Quench―When a router or host discards a datagram due to congestion, it sends a


source-quench message to the source host. This message acts as flow control.
Time Exceeded―Router discards a datagram when TTL field becomes 0 and a time
exceeded message is sent to the source host.
Parameter Problem―If a router discovers ambiguous or missing value in any field of the
datagram, it discards the datagram and sends parameter problem message to source.
Redirection―Redirect messages are sent by the default router to inform the source host
to update its forwarding table when the packet is routed on a wrong path.

ICMP Query Messages


Echo Request & Reply―Combination of echo request and reply messages
determines whether two systems communicate or not.
Timestamp Request & Reply―Two machines can use the timestamp request and reply
messages to determine the round-trip time (RTT).
Address Mask Request & Reply―A host to obtain its subnet mask, sends an address
mask request message to the router, which responds with an address mask reply
message.
Router Solicitation/Advertisement―A host broadcasts a router solicitation message to
know about the router. Router broadcasts its routing information with router advertisement
message.

ICMP MESSAGE FORMAT

An ICMP message has an 8-byte header and a variable-size data section.

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

Type Defines the type of the message


Code Specifies the reason for the particular message type
Checksum Used for error detection
Rest of the header Specific for each message type
Data Used to carry information
Identifier Used to match the request with the reply
Sequence Number Sequence Number of the ICMP packet

DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL

The dynamic host configuration protocol is used to simplify the installation and
maintenance of networked computers.
DHCP is derived from an earlier protocol called BOOTP.
Ethernet addresses are configured into network by manufacturer and they are
unique.
IP addresses must be unique on a given internetwork but also must reflect the
structure of the internetwork
Most host Operating Systems provide a way to manually configure the IP
information for the host
Drawbacks of manual configuration :
1. A lot of work to configure all the hosts in a large network
2. Configuration process is error-prune
It is necessary to ensure that every host gets the correct network number and that no two
hosts receive the same IP address.
For these reasons, automated configuration methods are required.
The primary method uses a protocol known as the Dynamic Host Configuration
Protocol (DHCP).
The main goal of DHCP is to minimize the amount of manual configuration
required for a host.
If a new computer is connected to a network, DHCP can provide it with all the necessary
information for full system integration into the network. DHCP is based on a client/server
model.

DHCP clients send a request to a DHCP server to which the server responds with an IP
address
DHCP server is responsible for providing configuration information to hosts.

CN 1.1 JNNIE/CSE/R-21/III YR/CN


CS3591- COMPUTER NETWORKS

There is at least one DHCP server for an administrative domain.


The DHCP server can function just as a centralized repository for host configuration
information.
The DHCP server maintains a pool of available addresses that it hands out to hosts on
demand.

DHCP Message Format


A DHCP packet is actually sent using a protocol called the User Datagram Protocol(UDP).

CN 1.1 JNNIE/CSE/R-21/III YR/CN

You might also like