Unit 3
Unit 3
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.
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.
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.
PACKET SWITCHING
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.
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
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
2. Classless Addressing
CLASSFUL ADDRESSING
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
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.
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
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?”
ARP Reply:
Router 137 responds with an ARP Reply which contains the hardware address
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
An ICMP message has an 8-byte header and a variable-size data section.
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.