191CS54 Computer Networks Notes
191CS54 Computer Networks Notes
SEMSTER :V
DEPARTMENT
OF
COMPUTER SCIENCE AND ENGINEERING
PREPARED BY
([Link], AP/CSE)
([Link] Aruna AP/CSE)
P.S.R. ENGINEERING COLLEGE, SIVAKASI – 626140
(An Autonomous Institution, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
COURSE PLAN
Academic Year: 2024-2025 (Odd Semester)
191CS54 COMPUTER NETWORKS L T P C
3 0 2 4
Programme: B.E. . Computer Science and Engineering Sem: 5 Category: PC
Prerequisite: NIL
Aim: To understand the concepts of computer networks, protocols and data communication.
Course Outcomes: The Students will be able to
CO1: Recall the fundamentals of a computer networks.
CO2: Identify and understand various IEEE Standards for LAN.
CO3: Illustrate multi-channel access Routing Protocols.
CO4: Outline the elements and protocols of transport layer.
CO5: Describe congestion in network layer with routing algorithms.
CO6: Discuss various Application Layer Protocols.
Text
[Link] Cum.
[Link] Topic Name Book with
Hrs Hours
page no
UNIT I – COMPUTER NETWORKS FUNDAMENTALS
LEARNING AND TEACHING AID: Chalk & Board, Presentation Slides
1. Building a network T1 1 1
2. Wired and Wireless Networks- Requirements T1 1 2
3. Layering and protocols T1 2 4
4. Internet Architecture T1 1 5
5. Network software - Performance T1 1 6
6. Link Layer Services – Framing T1 1 7
7. Error Detection – Flow control. T1 2 9
UNIT II – INTERNETWORKING AND MEDIA ACCESS CONTROL
LEARNING AND TEACHING AID: Chalk & Board, Presentation Slides
8. Media Access Control T1 1 10
9. Protocol Formats-Ethernet (802.3) T1 2 12
10. Wireless LANs – 802.11 – Bluetooth T1 2 14
11. Switching and Bridging T1 1 15
12. Basic Internetworking-Protocols T1 1 16
13. IP, CIDR, ARP, RARP, DHCP and ICMP T1 1 17
14. RFC for IP and ARP T1 1 18
UNIT III – ROUTING AND ROUTING PROTOCOLS
LEARNING AND TEACHING AID: Chalk & Board, Presentation Slides
15. Routing T1 1 19
16. RIP-OSPF-IGRP- EIGRP-Metrics T1 2 21
17. Switch Basics-Global Internet-Domains- BGP-IPv6 T1 1 22
18. Multicast Communication T1 1 23
19. IP addresses – Address Classes T1 1 24
20. Sub netting- Super netting- Examples T1 1 25
21. Multicast Routing - DVMRP-PIM T1 1 26
22. RFC – IPV6 and OSPF T1 1 27
UNIT IV – TRANSPORT LAYER
LEARNING AND TEACHING AID: Chalk & Board, Presentation Slides
23. Overview of Transport layer – TCP and UDP T1 2 29
24. Reliable byte Stream (TCP)- T1 1 30
25. Connection Management- Flow control – T1
2 32
Retransmission
26. TCP Congestion control T1 1 33
27. Congestion avoidance (DEC bit, RED) T1 1 34
28. QoS – Application requirements T1 1 35
29. RFC – TCP and UDP T1 1 36
UNIT V – APPLICATION LAYER AND CASE STUDIES
LEARNING AND TEACHING AID: Chalk & Board, Presentation Slides
1. Electronic Mail- SMTP, POP3, IMAP, MIME T1 2 38
2. HTTP and HTTPS – Web Services T1 1 39
3. DNS – SNMP V T1 2 41
4. Wireshark Packet Capturing Tool - Cisco Packet
website 2 43
Tracer Tool
5. Open Source Network Tools-Manage Engine
website 2 45
Tool.
LECTURE: 45, TOTAL: 45 HOURS
Text Books:
1. Larry L. Peterson, Bruce S. Davie, “Computer Networks: A Systems Approach”, Fifth
Edition, Morgan Kaufmann Publishers, 2011.
References:
1. James F. Kurose, Keith W. Ross, “Computer Networking - A Top-Down Approach
Featuring the Internet”, Fifth Edition, Pearson Education, 2009.
2. Nader. F. Mir, “Computer and Communication Networks”, Pearson Prentice Hall
Publishers, 2010.
3. Ying-Dar Lin, Ren-Hung Hwang, Fred Baker, “Computer Networks: An Open Source
Approach”, McGraw Hill Publisher, 2011
4. Behrouz A. Forouzan, “Data communication and Networking”, 4/e, Tata McGraw-Hill,
2011.
Web Links:
[Link]
[Link]
PREPARED BY
([Link], AP/CSE)
([Link] Aruna AP/CSE)
UNIT 1 – COMPUTER NETWORK FUNDAMENTALS
BUILDING A NETWORK
INTRODUCTION TO NETWORKS
A network is a set of devices (often referred to as nodes) connected bycommunication
links.
A node can be a computer, printer, or any other device capable of sending or
receiving data generated by other nodes on the network.
When we communicate, we are sharing information. This sharing can be local orremote.
CHARACTERISTICS OF A NETWORK
The effectiveness of a network depends on three characteristics.
1. Delivery: The system must deliver data to the correct destination.
2. Accuracy: The system must deliver data accurately.
3. Timeliness: The system must deliver data in a timely manner.
Factors that affect the Factors that affect the Factors that affect the
Performance of a network: Reliability of a network: Security of a network:
1. Number of users 1. Efficiency of software. [Link] data from
2. Type of transmission medium 2. Frequency of failure unauthorized access and
3. Capabilities of the connected3. Recovery time of a network viruses.
hardware after a failure
TRANSMISSION MODES
o The way in which data is transmitted from one device to another device is known as
transmission mode.
o The transmission mode is also known as the communication mode.
o Each communication channel has a direction associated with it, and transmission media
provide the direction. Therefore, the transmission mode is also known as a directional
mode.
o The transmission mode is defined in the physical layer.
SIMPLEX MODE
o In Simplex mode, the communication is unidirectional, i.e., the data flow in one
direction.
o A device can only send the data but cannot receive it or it can receive the data but cannot
send the data.
o This transmission mode is not very popular as mainly communications require the two-
way exchange of data. The simplex mode is used in the business field as in sales that do
not require any corresponding reply.
o The radio station is a simplex channel as it transmits the signal to the listeners but never
allows them to transmit back.
o Keyboard and Monitor are the examples of the simplex mode as a keyboard can only
accept the data from the user and monitor can only be used to display the data on the
screen.
o In the simplex mode the full capacity of the communication channel can be utilized
during transmission.
HALF-DUPLEX MODE
o In a Half-duplex channel, direction can be reversed, i.e., the station can transmit and
receive the data as well.
o Messages flow in both the directions, but not at the same time.
o The entire bandwidth of the communication channel is utilized in one direction at a time.
o In half-duplex mode, it is possible to perform the error detection, and if any erroroccurs,
then the receiver requests the sender to retransmit the data.
o A Walkie-talkie is an example of the Half-duplex mode.
o In Walkie-talkie, one party speaks, and another party listens. After a pause, the other
speaks and first party listens. Speaking simultaneously will create the distorted sound
which cannot be understood.
Send/Receive A device can only send the Both the devices can Both the devicescan
data but cannot receive it or send and receive the send and receive the
it can only receive the data data, but one at a time. data simultaneously.
but cannotsend it.
ii. MultiPoint : It is also called Multidrop configuration. In this connection two or more
devices share a single [Link] are two kinds of Multipoint Connections.
Spatial Sharing: If several devices can share the link simultaneously,it is called
Spatially shared line configuration
Temporal (Time) Sharing: If users must take turns using the link ,then its called
Temporally shared or Time Shared Line Configuration.
NETWORK TOPOLOGY
Two or more devices connect to a link. Two or more links form a topology. Topology
isdefined as
(1) The way in which a network is laid out physically.
(2) The geometric representation of the relationship of all the links and nodes to one-another.
Network topology refers to the arrangement of different elements like nodes, links, and
devices in a computer network. It defines how these components are connected and interact
with each other.
The various types of topologies are :
Bus
Ring
Tree
Star
Mesh
Hybrid.
BUS TOPOLOGY
Bus topology is a network type in which every computer and network device is
connected to single cable.
The long single cable acts as a backbone to link all the devices in a network.
When it has exactly two endpoints, then it is called Linear Bus topology.
It transmits data only in one direction.
RING TOPOLOGY
In a ring topology, each device has a dedicated point-to-point connection with only
the two devices on either side of it.
A signal is passed along the ring in one direction, from device to device, until it reaches
its destination.
Each device in the ring incorporates a repeater.
When a device receives a signal intended for another device, its repeater regenerates
the bits and passes them along.
Advantages of Ring Topology Disadvantages of Ring Topology
1. Transmitting network is not affected by 1. Troubleshooting is difficult in ring
high traffic or by adding more nodes, topology.
as only the nodes having tokens can 2. Adding or deleting the computers
transmit data. disturbs the network activity.
2. Cheap to install and expand 3. Failure of one computer disturbs the
whole network
TREE TOPOLOGY
It has a root node and all other nodes are connected to it forming a hierarchy.
It is also called hierarchical topology.
It should at least have three levels to the hierarchy.
Tree topology is ideal if workstations are located in groups.
They are used in Wide Area Network.
STAR TOPOLOGY
In a star topology, each device has a dedicated point-to-point link only to a
central controller, usually called a hub.
The devices are not directly linked to one another.
The controller acts as an exchange.
If one device wants to send data to another, it sends the data to the controller,
which then relays the data to the other connected device.
MESH TOPOLOGY
HYBRID TOPOLOGY
NETWORK TYPES
A computer network is a group of computers linked to each other that enables the
computer to communicate with another computer and share their resources, data, and
applications.
A computer network can be categorized by their size.
A computer network is mainly of three types:
1. Local Area Network (LAN)
2. Wide Area Network (WAN)
3. Metropolitan Area Network (MAN)
LOCAL AREA NETWORK (LAN)
o Local Area Network is a group of computers connected to each other in a small area such
as building, office.
o LAN is used for connecting two or more personal computers through a communication
medium such as twisted pair, coaxial cable, etc.
ss
INTERNETWORK
Types of Internetwork
Extranet Intranet
An extranet is used for information sharing. An intranet belongs to an
The access to the extranet is restricted to only organization which is only
those users who have login credentials. accessible by the organization's
An extranet is the lowest level of employee or members. The main
internetworking. aim of the intranet is to share the
It can be categorized as MAN, WAN or other information and resources among
computer networks. the organization employees.
An extranet cannot have a single LAN, An intranet provides the facility to
atleast it must have one connection to the work in groups and for
external network. teleconferences.
TRANSMISSION MEDIA
o Transmission media is a communication channel that carries the information from the
sender to the receiver.
o Data is transmitted through the electromagnetic signals.
o The main functionality of the transmission media is to carry the information in the form
of bits (Either as Electrical signals or Light pulses).
o It is a physical path between transmitter and receiver in data communication.
o The characteristics and quality of data transmission are determined by the characteristics
of medium and signal.
o Transmission media is of two types: Guided Media (Wired) and UnGuided Media
(wireless).
o In guided (wired) media, medium characteristics are more important whereas, in
unguided (wireless) media, signal characteristics are more important.
o Different transmission media have different properties such as bandwidth, delay,cost and
ease of installation and maintenance.
o The transmission media is available in the lowest layer of the OSI reference model,
i.e., Physical layer.
o Attenuation: Attenuation means the loss of energy, i.e., the strength of the signal
decreases with increasing the distance which causes the loss of energy.
o Distortion: Distortion occurs when there is a change in the shape of the signal. This type
of distortion is examined from different signals having different frequencies. Each
frequency component has its own propagation speed, so they reach at a different time
which leads to the delay distortion.
o Noise: When data is travelled over a transmission medium, some unwanted signal is
added to it which creates the noise.
TYPES / CLASSES OF TRANSMISSION MEDIA
GUIDED MEDIA
It is defined as the physical medium through which the signals are transmitted.
It is also known as Bounded media.
Types of Guided media: Twisted Pair Cable, Coaxial Cable , Fibre Optic Cable
TWISTED PAIR CABLE
Twisted pair is a physical media made up of a pair of cables twisted with each other.
A twisted pair cable is cheap as compared to other transmission media.
Installation of the twisted pair cable is easy, and it is a lightweight cable.
The frequency range for twisted pair cable is from 0 to 3.5KHz.
A twisted pair consists of two insulated copper wires arranged in a regular spiral pattern.
Unshielded Twisted Pair
An unshielded twisted pair is widely used in telecommunication. Following are the categories
of the unshielded twisted pair cable:
o Category 1: Suports low-speed data.
o Category 2: It can support upto 4Mbps.
Advantages :
o It is cheap.
o Installation of the unshielded twisted pair is easy.
o It can be used for high-speed LAN.
Disadvantage:
o This cable can only be used for shorter distances because of attenuation.
Shielded Twisted Pair
A shielded twisted pair is a cable that contains the mesh surrounding the wire that allows the
higher transmission rate.
Advantages :
o The cost of the shielded twisted pair cable is not very high and not very low.
o Installation of STP is easy.
o It has higher capacity as compared to unshielded twisted pair cable.
o It is shielded that provides the higher data transmission rate.
Disadvantages:
o It is more expensive as compared to UTP and coaxial cable.
o It has a higher attenuation rate.
COAXIAL CABLE
Disadvantages :
o It is more expensive as compared to twisted pair cable.
o If any fault occurs in the cable causes the failure in the entire network.
o Fibre optic cable is a cable that uses electrical signals for communication.
o Fibre optic is a cable that holds the optical fibres coated in plastic that are used to send
the data by pulses of light.
o The plastic coating protects the optical fibres from heat, cold, electromagnetic
interference from other types of wiring.
o Fibre optics provide faster data transmission than copper wires.
Advantages:
o Greater Bandwidth
o Less signal attenuation
o Immunity to electromagnetic interference
o Resistance to corrosive materials
o Light weight
o Greater immunity to tapping
Disadvantages :
o Requires Expertise for Installation and maintenance
o Unidirectional light propagation.
o Higher Cost.
Propagation Modes of Fibre Optics
Current technology supports two modes (multimode and single mode) for propagating
light along optical channels, each requiring fiber with different physical characteristics.
Multimode can be implemented in two forms: step-index or graded-index.
Multimode Propagation
Multimode is so named because multiple beams from a light source move through the
core in different paths.
How these beams move within the cable depends on the structure of the core.
Single-mode uses step-index fiber and a highly focused source of light that limits beams
to a small range of angles, all close to the horizontal.
The single-mode fiber itself is manufactured with a much smaller diameter than that of
multimode fiber, and with substantially lower density (index of refraction).
The decrease in density results in a critical angle that is close enough to 90° to make the
propagation of beams almost horizontal.
In this case, propagation of different beams is almost identical, and delays are negligible.
All the beams arrive at the destination “together” and can be recombined with little
distortion to the signal.
UNGUIDED MEDIA
o An unguided transmission transmits the electromagnetic waves without using any
physical medium. Therefore it is also known as wireless transmission.
o In unguided media, air is the media through which the electromagnetic energy
can flow easily.
RADIO WAVES
o Radio waves are the electromagnetic waves that are transmitted in all the directions of
free space.
o Radio waves are omnidirectional, i.e., the signals are propagated in all the directions.
o The range in frequencies of radio waves is from 3Khz to 1Khz.
o In the case of radio waves, the sending and receiving antenna are not aligned, i.e.,the
wave sent by the sending antenna can be received by any receiving antenna.
o An example of the radio wave is FM radio.
Applications of Radio waves:
o A Radio wave is useful for multicasting when there is one sender and many
receivers.
o An FM radio, television, cordless phones are examples of a radio wave.
Satellite Microwave
o A satellite is a physical object that revolves around the earth at a known height.
o Satellite communication is more reliable nowadays as it offers more flexibility than
cable and fibre optic systems.
o We can communicate with any point on the globe by using satellite communication.
o The satellite accepts the signal that is transmitted from the earth station, and it
amplifies the signal. The amplified signal is retransmitted to another earth station.
INFRARED WAVES
Characteristics of Infrared:
o It supports high bandwidth, and hence the data rate will be very high.
o Infrared waves cannot penetrate the walls. Therefore, the infrared communication in one
room cannot be interrupted by the nearby rooms.
o An infrared communication provides better security with minimum interference.
o Infrared communication is unreliable outside the building because the sun rays will
interfere with the infrared waves.
CONNECTING DEVICES
Connecting devices are used to connect hosts together to make a network or to connect
networks together to make an internet.
Connecting devices can operate in different layers of the Internet model.
Connecting devices are divided into five different categories on the basis of layers
in which they operate in the network.
1. Devices which operate below the physical layer - Passive hub.
2. Devices which operate at the physical layer - Repeater.
3. Devices which operate at the physical and data link layers - Bridge.
4. Devices which operate at the physical layer, data link layer and network layer –Router.
5. Devices which operate at all five layers - Gateway.
1. HUBS
Several networks need a central location to connect media segments together. These
central locations are called as hubs.
The hub organizes the cables and transmits incoming signals to the other media
segments.
i) Passive hub
It is a connector, which connects wires coming from the different branches.
By using passive hub, each computer can receive the signal which is sent
from all other computers connected in the hub.
A repeater receives the signal and it regenerates the signal in original bit pattern
before the signal gets too weak or corrupted.
It is used to extend the physical distance of LAN.
Repeater works on physical layer.
A repeater has no filtering capability.
[Link]
Types of Bridges :
Transparent Bridges
These are the bridge in which the stations are completely unaware of the bridge’s
existence i.e. whether or not a bridge is added or deleted from the network ,
reconfiguration of the stations is unnecessary.
Source Routing Bridges
In these bridges, routing operation is performed by source station and the frame
specifies which route to follow.
Translation Bridges
These bridges connect networks with different architectures, such as Ethernet and
Token Ring. These bridges appear as:
– Transparent bridges to an Ethernet host
– Source-routing bridges to a Token Ring host
4. SWITCHES
◾ A switch is a small hardware device which is used to join multiple computers
together with one local area network (LAN).
◾ A switch is a mechanism that allows us to interconnect links to form a large network.
◾ Switch is data link layer device.
◾ A switch is a multi port bridge with a buffer .
◾ Switches are used to forward the packets based on MAC addresses.
◾ It is operated in full duplex mode.
◾ Packet collision is minimum as it directly communicates between source and
destination.
◾ It does not broadcast the message as it works with limited bandwidth.
◾ A switch’s primary job is to receive incoming packets on one of its links and to
transmit them on some other link.
◾ A Switch is used to transfer the data only to the device that has been addressed.
Input ports receive stream of packets, analyzes the header, determines the output
port and passes the packet onto the fabric.
Ports contain buffers to hold packets before it is forwarded.
If buffer space is unavailable, then packets are dropped.
If packets at several input ports queue for a single output port, then only one of them
is forwarded.
Types of Switch
[Link]
A router is a three-layer device.
It operates in the physical, data-link, and network layers.
As a physical-layer device, it regenerates the signal it receives.
As a link-layer device, the router checks the physical addresses (source and destination)
contained in the packet.
As a network-layer device, a router checks the network-layer addresses.
A router is a device like a switch that routes data packets based on their IPaddresses.
A router can connect networks. A router connects the LANs and WANs on the internet.
A router is an internetworking device.
It connects independent networks to form an internetwork.
The key function of the router is to determine the shortest path to the
destination.
Router has a routing table, which is used to make decision on selecting the route.
The routing table is updated dynamically based on which they makedecisions on routing
the data packets.
[Link]
A gateway is a device, which operates in all five layers of the internet or seven layers
of OSI model.
It is usually a combination of hardware and software.
Gateway connects two independent networks.
[Link]
Brouter is a hybrid device. It combines the features of both bridge androuter.
Brouter is a combination of Bridge and Router.
Functions as a bridge for nonroutable protocols and a router for routableprotocols.
As a router, it is capable of routing packets across networks.
As a bridge, it is capable of filtering local area network traffic.
Provides the best attributes of both a bridge and a router
Operates at both the Data Link and Network layers and can replace separate bridges and
routers.
PROTOCOL LAYERING
In networking, a protocol defines the rules that both the sender and receiver and all
intermediate devices need to follow to be able to communicate effectively.
A protocol provides a communication service that the process use to exchange
messages.
When communication is simple, we may need only one simple protocol.
When the communication is complex, we may need to divide the task between different
layers, in which case we need a protocol at each layer, or protocol layering.
Protocol layering is that it allows us to separate the services from the implementation.
A layer needs to be able to receive a set of services from the lower layer and to give the
services to the upper layer.
Any modification in one layer will not affect the other layers.
Protocol Graph
The set of protocols that make up a network system is called a protocol graph.
The nodes of the graph correspond to protocols, and the edges represent a dependence
relation.
For example, the Figure below illustrates a protocol graph consists of protocols RRP
(Request/Reply Protocol) and MSP (Message Stream Protocol) implement two different
types of process-to-process channels, and both depend on the HHP (Host-to- Host
Protocol) which provides a host-to-host connectivity service
OSI MODEL
o OSI stands for Open System Interconnection.
o It is a reference model that describes how information from a software application in one
computer moves through a physical medium to the software application in another
computer.
o OSI consists of seven layers, and each layer performs a particular network function.
o OSI model was developed by the International Organization for Standardization (ISO)
in 1984, and it is now considered as an architectural model for the inter- computer
communications.
o OSI model divides the whole task into seven smaller and manageable tasks. Each layer
is assigned a particular task.
o Each layer is self-contained, so that task assigned to each layer can be performed
independently.
The physical layer coordinates the functions required to transmit a bit stream over a physical
medium.
The physical layer is concerned with the following functions:
Physical characteristics of interfaces and media - The physical layer defines the
characteristics of the interface between the devices and the transmission medium.
Representation of bits - To transmit the stream of bits, it must be encoded to signals. The
physical layer defines the type of encoding.
Signals: It determines the type of the signal used for transmitting the information.
Data Rate or Transmission rate - The number of bits sent each second –is also defined
by the physical layer.
Synchronization of bits - The sender and receiver must be synchronized at the bit
level. Their clocks must be synchronized.
Line Configuration - In a point-to-point configuration, two devices are connected
together through a dedicated link. In a multipoint configuration, a link is shared between
several devices.
Physical Topology - The physical topology defines how devices are connected to make a
network. Devices can be connected using a mesh, bus, star or ring topology.
Transmission Mode - The physical layer also defines the direction of transmission
between two devices: simplex, half-duplex or full-duplex.
2. DATA LINK LAYER
It is responsible for transmitting frames from one node to the next node. The other
responsibilities of this layer are
Framing - Divides the stream of bits received into data units called frames.
Physical addressing – If frames are to be distributed to different systems on the network
, data link layer adds a header to the frame to define the sender and receiver.
Flow control- If the rate at which the data are absorbed by the receiver is lessthan the
rate produced in the sender ,the Data link layer imposes a flow ctrl mechanism.
Error control- Used for detecting and retransmitting damaged or lost frames and to
prevent duplication of frames. This is achieved through a trailer added at the end of the
frame.
Medium Access control -Used to determine which device has control over the link at any
given time.
3. NETWORK LAYER
This layer is responsible for the delivery of packets from source to destination.
It determines the best path to move data from source to the destination based on the
network conditions, the priority of service, and other factors.
The other responsibilities of this layer are
Logical addressing - If a packet passes the network boundary, we need another
addressing system for source and destination called logical address. This addressing is
used to identify the device on the internet.
Routing – Routing is the major component of the network layer, and it determines the
best optimal path out of the multiple paths from source to the destination.
4. TRANSPORT LAYER
It is responsible for Process to Process delivery. That is responsible for source-to- destination
(end-to-end) delivery of the entire message, It also ensures whether the message arrives in
order or not.
The other responsibilities of this layer are
Port addressing / Service Point addressing - The header includes an address called port
address / service point address. This layer gets the entire message to the correct process
on that computer.
Segmentation and reassembly - The message is divided into segments and each segment
is assigned a sequence number. These numbers are arranged correctly onthe arrival side
by this layer.
Connection control - This can either be connectionless or connection oriented.
The connectionless treats each segment as an individual packet anddelivers to the
destination.
The connection-oriented makes connection on the destination side before the
delivery. After the delivery the termination will be terminated.
Flow control -The transport layer also responsible for flow control but it is performed
end-to-end rather than across a single link.
Error Control - Error control is performed end-to-end rather than across thesingle
link.
5. SESSION LAYER
This layer establishes, manages and terminates connections between applications. The
other responsibilities of this layer are
Dialog control - Session layer acts as a dialog controller that creates a dialog between
two processes or we can say that it allows the communication between two processes
which can be either half-duplex or full-duplex.
Synchronization- Session layer adds some checkpoints when transmitting the data in a
sequence. If some error occurs in the middle of the transmission of data, then the
transmission will take place again from the checkpoint. This process is known as
Synchronization and recovery.
6. PRESENTATION LAYER
It is concerned with the syntax and semantics of information exchanged between two
systems.
The other responsibilities of this layer are
Translation – Different computers use different encoding system, this layer is
responsible for interoperability between these different encoding methods. It will change
the message into some common format.
Encryption and decryption-It means that sender transforms the original information to
another form and sends the resulting message over the n/w. and vice versa.
Compression and expansion-Compression reduces the number of bits contained in the
information particularly in text, audio and video.
7. APPLICATION LAYER
This layer enables the user to access the network. It handles issues such as network
transparency, resource allocation, etc. This allows the user to log on to remote user.
The other responsibilities of this layer are
FTAM (File Transfer, Access, Management) - Allows user to access files in aremote
host.
Mail services - Provides email forwarding and storage.
Directory services - Provides database sources to access information about various
sources and objects.
Internet Architecture
TCP/IP PROTOCOL SUITE
The TCP/IP architecture is also called as Internet architecture. It is developed by the US
Defense Advanced Research Project Agency (DARPA)for its packet switched network
(ARPANET). TCP/IP is a protocol suite used in the Internet today. It is a 4-layer model. The
layers of TCP/IP are
APPLICATION LAYER
An application layer incorporates the function of top three OSI layers. An application
layer is the topmost layer in the TCP/IP model.
It is responsible for handling high-level protocols, issues of representation.
This layer allows the user to interact with the application.
When one application layer protocol wants to communicate with another application
layer, it forwards its data to the transport layer.
Protocols such as FTP, HTTP, SMTP, POP3, etc running in the application layer
provides service to other program running on top of application layer.
TRANSPORT LAYER
The transport layer is responsible for the reliability, flow control, and correction of data
which is being sent over the network.
The two protocols used in the transport layer are User Datagram protocol and
Transmission control protocol.
o UDP – UDP provides connectionless service and end-to-end delivery of
transmission. It is an unreliable protocol as it discovers the errors but not specify
the error.
o TCP – TCP provides a full transport layer services to applications. TCP is a
reliable protocol as it detects the error and retransmits the damaged frames.
INTERNET LAYER
The internet layer is the second layer of the TCP/IP model.
An internet layer is also known as the network layer.
The main responsibility of the internet layer is to send the packets from any network,
and they arrive at the destination irrespective of the route they take.
Internet layer handle the transfer of information across multiple networks through router
and gateway.
IP protocol is used in this layer, and it is the most significant part of the entire TCP/IP
suite.
NETWORK INTERFACE LAYER
The network interface layer is the lowest layer of the TCP/IP model.
This layer is the combination of the Physical layer and Data Link layer defined in the
OSI reference model.
It defines how the data should be sent physically through the network.
This layer is mainly responsible for the transmission of the data between two devices
on the same network.
The functions carried out by this layer are encapsulating the IP datagram into frames
transmitted by the network and mapping of IP addresses into physical addresses.
The protocols used by this layer are Ethernet, token ring, FDDI, X.25, frame relay.
COMPARISON - OSI MODEL AND TCP/IP MODEL
NETWORK SOFTWARE
When implementing a network application is the interface exported by the network.
Since most network protocols are implemented in software, and nearly all computer systems
implement their network protocols as part of the operating system, when we refer to the
interface “exported by the network,” that the OS provides to its networking subsystem. This
interface is often called the network application programming interface (API). Although each
operating system is free to define its own network API. Socket Interface provided by Berkeley
distribution of unix.
Introduction to Sockets
A socket is one endpoint of a two way communication link between two programs
running on the network. The socket mechanism provides a means of inter-process
communication (IPC) by establishing named contact points between which the communication
take place.
Like ‘Pipe’ is used to create pipes and sockets is created using ‘socket’ system call.
The socket provides bidirectional FIFO Communication facility over the network. A socket
connecting to the network is created at each end of the communication. Each socket has a
specific address. This address is composed of an IP address and a port number.
Socket are generally employed in client server applications. The server creates a
socket, attaches it to a network port addresses then waits for the client to contact it. The client
creates a socket and then attempts to connect to the server socket. When the connection is
established, transfer of data takes place.
The first step is to create a socket, which is done with the following operation:
int socket(int domain, int type, int protocol)
Where:
domain—parameter specifies the protocol family
o i.e., PF-INET :- Denotes the internet family
o PF-UNIX:- Denotes the UNIX pipe facility
o PF-PACKET:- Denotes direct access to the network interface
type: the type argument indicates the symounties of the communication
o SOCK-STREAM—Used to denote a byte stream.
o SOCK-DGRAM—denotes the message oriented services provides by UDP.
Protocol: This argument identifies the specific protocol that is going to be used.
o Ex: UNSPEC—Combination of protocol family internet and socket stream which
implies TCP.
The next step depends on whether you are a client or a server. On a server machine,
the application process performs a passive open—the server says that it is prepared to accept
connections, but it does not actually establish a connection.
The server does this by invoking the following three operations:
int bind(int socket, struct sockaddr *address, int addr len)
int listen(int socket, int backlog)
int accept(int socket, struct sockaddr *address, int *addr len)
The bind operation, as its name suggests, binds the newly created socket to the
specified address. This is the network address of the local participant—the server. When we
use it with the internet protocol, the address is a data structure that includes both the IP address
of the server and a ASP port number. Ex: web serves commonly accept connections on port.
The listen operation then defines how many connections can be pending on the
specified socket.
Finally, the accept operation carries out the passive open. It is a blocking operation
that does not return until a remote participant has established a connection, and when it does
complete it returns a new socket that corresponds to this just-established connection, and the
address argument contains the remote participant’s address.
On the client machine, the application process performs an active open; that is, it
says who it wants to communicate with by invoking the following single operation:
int connect(int socket, struct sockaddr *address, int addr len)
This operation does not return until TCP has successfully established a connection,
at which time the application is free to begin sending data. In this case, address contains the
remote participant’s address. In practice, the client usually specifies only the remote
participant’s address and lets the system fill in the local information. Whereas a server usually
listens for messages on a well-known port, a client typically does not care which port it uses
for itself; the OS simply selects an unused one.
Once a connection is established, the application processes invoke the following two
operations to send and receive data:
int send(int socket, char *message, int msg len, int flags)
int recv(int socket, char *buffer, int buf len, int flags)
The first operation sends the given message over the specified socket, while the
second operation receives a message from the specified socket into the given buffer. Both
operations take a set of flags that control certain details of the operation.
Example Application
CLIENT
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define SERVER_PORT 5432
#define MAX_LINE 256
int main(int argc, char * argv[]) {
FILE *fp;
struct hostent *hp;
struct sockaddr_in sin;
char *host;
char buf[MAX_LINE];
int s;
int len;
if (argc==2) {
host = argv[1];
}
else {
fprintf(stderr, "usage: simplex-talk host\n");
exit(1);
}
/* translate host name into peer's IP address */
hp = gethostbyname(host);
if (!hp) {
fprintf(stderr, "simplex-talk: unknown host: %s\n", host);
exit(1);
}
/* build address data structure */
bzero((char *)&sin, sizeof(sin));
sin.sin_family = AF_INET;
bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length);
sin.sin_port = htons(SERVER_PORT);
/* active open */
if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) {
perror("simplex-talk: socket");
exit(1);
}
if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0){
perror("simplex-talk: connect");
close(s);
exit(1);
}
/* main loop: get and send lines of text */
while (fgets(buf, sizeof(buf), stdin)) {
buf[MAX_LINE-1] = '\0';
len = strlen(buf) + 1;
send(s, buf, len, 0);
}}
SERVER
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define SERVER_PORT 5432
#define MAX_PENDING 5
#define MAX_LINE 256
int
main()
{
struct sockaddr_in sin;
char buf[MAX_LINE];
int len;
int s, new_s;
/* build address data structure */
bzero((char *)&sin, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_port = htons(SERVER_PORT);
/* setup passive open */
if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) {
perror("simplex-talk: socket");
exit(1);
}
if ((bind(s, (struct sockaddr *)&sin, sizeof(sin))) < 0) {
perror("simplex-talk: bind");
exit(1);
}
listen(s, MAX_PENDING);
/* wait for connection, then receive and print text */
while(1) {
if ((new_s = accept(s, (struct sockaddr *)&sin, &len)) < 0) {
perror("simplex-talk: accept");
exit(1);
}
while (len = recv(new_s, buf, sizeof(buf), 0))
fputs(buf, stdout);
close(new_s);
}}
NETWORK PERFORMANCE
Network performance is measured in using:
o Bandwidth
o Throughput
o Latency
o Jitter
o RoundTrip Time
BANDWIDTH
The bandwidth of a network is given by the number of bits that can be transmitted
over the network in a certain period of time.
Bandwidth can be measured in two different values: bandwidth in hertz and
bandwidth in bits per second.
Bandwidth in Hertz
o Bandwidth in hertz refers to the range of frequencies contained in a composite signal
or the range of frequencies a channel can pass.
o For example, we can say the bandwidth of a subscriber telephone line is 4 kHz.
Relationship
o There is an explicit relationship between the bandwidth in hertz and bandwidth inbits
per second.
o Basically, an increase in bandwidth in hertz means an increase in bandwidthin bits per
second.
THROUGHPUT
Throughput is a measure of how fast we can actually send data through a network.
Bandwidth in bits per second and throughput may seem to be same, but they are
different.
A link may have a bandwidth of B bps, but we can only send T bps through this link. (T
always less than B).
In other words, the bandwidth is a potential measurement of a link; the throughput is an
actual measurement of how fast we can send data.
For example, we may have a link with a bandwidth of 1 Mbps, but the devices connected
to the end of the link may handle only 200 kbps. This means that we cannot send more
than 200 kbps through this link.
Problem :
A network with bandwidth of 10 Mbps can pass only an average of 12,000 frames per minute
with each frame carrying an average of 10,000 bits. What is the throughput of this network?
Solution
We can calculate the throughput as
LATENCY (DELAY)
The latency or delay defines how long it takes for an entire message to travel from one
end of a network to the other.
Latency is made up of four components: Propagation time, Transmission time, Queuing
time and Processing delay.
Propagation Time
o Propagation time measures the time required for a bit to travel from the source tothe
destination.
o The propagation time is calculated by dividing the distance by the propagationspeed.
o The propagation speed of electromagnetic signals depends on the medium and onthe
frequency of the signal.
Transmission Time
o In data communications we don’t send just 1 bit, we send a message.
o The first bit may take a time equal to the propagation time to reach its destination.
o The last bit also may take the same amount of time.
o However, there is a time between the first bit leaving the sender and the last bit arriving
at the receiver.
o The first bit leaves earlier and arrives earlier.
o The last bit leaves later and arrives later.
o The transmission time of a message depends on the size of the message and the
bandwidth of the channel.
Queuing Time
o Queuing time is the time needed for each intermediate or end device to hold themessage
before it can be processed.
o The queuing time is not a fixed factor. It changes with the load imposed on thenetwork.
When there is heavy traffic on the network, the queuing time increases.
o An intermediate device, such as a router, queues the arrived messages andprocesses
them one by one.
o If there are many messages, each message will have to wait.
Processing Delay
o Processing delay is the time that the nodes take to process the packet header.
o Processing delay is a key component in network delay.
o During processing of a packet, nodes may check for bit-level errors in the packet that
occurred during transmission as well as determining where the packet's next destination
is.
Bandwidth - Delay Product
o Bandwidth and delay are two performance metrics of a link.
o The bandwidth-delay product defines the number of bits that can fill thelink.
o This measurement is important if we need to send data in bursts and wait for the
acknowledgment of each burst before sending the next one.
JITTER
RTT refers to how long it takes to send a message from one end of a network to the
other and back, rather than the one-way latency. This is called as round-trip time (RTT) of
the network.
DLC SERVICES
The data link control (DLC) deals with procedures for communication between two
adjacent nodes—node-to-node communication—no matter whether the link is dedicated or
broadcast.
Data link control service include
(1) Framing (2) Flow Control (3) Error Control
FRAMING
The data-link layer packs the bits of a message into frames, so that eachframe is
distinguishable from another.
Although the whole message could be packed in one frame, that is notnormally
done.
One reason is that a frame can be very large, making flow and error control very
inefficient.
When a message is carried in one very large frame, even a single-bit errorwould
require the retransmission of the whole frame.
When a message is divided into smaller frames, a single-bit error affectsonly that
small frame.
Framing in the data-link layer separates a message from one source to adestination
by adding a sender address and a destination address.
The destination address defines where the packet is to go; the senderaddress helps the
recipient acknowledge the receipt.
Frame Size
Frames can be of fixed or variable size.
Frames of fixed size are called cells. In fixed-size framing, there is no need for defining
the boundaries of the frames; the size itself can be used as a delimiter.
In variable-size framing, we need a way to define the end of one frame and the beginning
of the next. Two approaches were used for this purpose: a character-oriented approach
and a bit-oriented approach.
Character-Oriented Framing
In character-oriented (or byte-oriented) framing, data to be carried are 8-bitcharacters.
To separate one frame from the next, an 8-bit (1-byte) flag is added at thebeginning
and the end of a frame.
The flag, composed of protocol-dependent special characters, signals thestart or end
of a frame.
Any character used for the flag could also be part of the information.
If this happens, when it encounters this pattern in the middle of the data,thereceiver
thinks it has reached the end of the frame.
To fix this problem, a byte-stuffing strategy was added to character-oriented framing.
Byte Stuffing (or) Character Stuffing
Byte stuffing is the process of adding one extra byte whenever there is a flag or escape
character in the text.
In byte stuffing, a special byte is added to the data section of the frame when there
is a character with the same pattern as the flag.
The data section is stuffed with an extra byte. This byte is usually called the escape
character (ESC) and has a predefined bit pattern.
Whenever the receiver encounters the ESC character, it removes it from the data section
and treats the next character as data, not as a delimiting flag.
Bit-Oriented Framing
In bit-oriented framing, the data section of a frame is a sequence of bits tobe interpreted
by the upper layer as text, graphic, audio, video, and so on.
In addition to headers and trailers), we still need a delimiter to separate oneframe from
the other.
Most protocols use a special 8-bit pattern flag, 01111110, as the delimiter todefine the
beginning and the end of the frame
If the flag pattern appears in the data, the receiver must be informed thatthis is not the
end of the frame.
This is done by stuffing 1 single bit (instead of 1 byte) to prevent the patternfrom
looking like a flag. The strategy is called bit stuffing.
Bit Stuffing
Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a
0 in the data, so that the receiver does not mistake the pattern 0111110 for a flag.
In bit stuffing, if a 0 and five consecutive 1 bits are encountered, an extra 0 is added.
This extra stuffed bit is eventually removed from the data by the receiver.
The extra bit is added after one 0 followed by five 1’s regardless of the
value of the next bit.
This guarantees that the flag field sequence does not inadvertently appear inthe frame.
FLOW CONTROL
o Flow control refers to a set of procedures used to restrict the amountof data that
the sender can send before waiting for acknowledgment.
o The receiving device has limited speed and limited memory to store thedata.
o Therefore, the receiving device must be able to inform the sending device to stop the
transmission temporarily before the limits are reached.
o It requires a buffer, a block of memory for storing the information until they are
processed.
o If the acknowledgement is not received within the allotted time, then the sender
assumes that the frame is lost during the transmission, so it will retransmit the frame.
o The acknowledgement may not arrive because of the following three scenarios :
1. Original frame is lost
2. ACK is lost
3. ACK arrives after the timeout
Advantage of Stop-and-wait
o The Stop-and-wait method is simple as each frame is checked and acknowledged before
the next frame is sent
Disadvantages of Stop-And-Wait
o In stop-and-wait, at any point in time, there is only one frame that is sentand
waiting to be acknowledged.
o This is not a good use of transmission medium.
o To improve efficiency, multiple frames should be in transition whilewaiting for
ACK.
PIGGYBACKING
SLIDING WINDOW
o The Sliding Window is a method of flow control in which a sender can transmit the
several frames before getting an acknowledgement.
o In Sliding Window Control, multiple frames can be sent one after theanother due to which
capacity of the communication channel can be utilizedefficiently.
o A single ACK acknowledge multiple frames.
o Sliding Window refers to imaginary boxes at both the sender and receiver end.
o The window can hold the frames at either end, and it provides the upper limit on the
number of frames that can be transmitted before the acknowledgement.
o Frames can be acknowledged even when the window is not completely filled.
o The window has a specific size in which they are numbered as modulo-n means that they
are numbered from 0 to n-1.
o For example, if n = 8, the frames are numbered from
0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1........
o The size of the window is represented as n-1. Therefore, maximum n-1frames can
be sent before acknowledgement.
o When the receiver sends the ACK, it includes the number of the next framethat it wants
to receive.
o For example, to acknowledge the string of frames ending with framenumber 4, the
receiver will send the ACK containing the number 5.
o When the sender sees the ACK with the number 5, it got to know that theframes from
0 through 4 have been received.
Sender Window Receiver Window
Data can be corrupted during transmission. For reliable communication, errors must be
detected and corrected. Error Control is a technique of error detection and retransmission.
TYPES OF ERRORS
SINGLE-BIT ERROR
The term Single-bit error means that only one bit of a given data unit (such as byte,character,
data unit or packet) is changed from 1 to 0 or from 0 to 1.
BURST ERROR
The term Burst Error means that two or more bits in the data unit have changedfrom 1 to
0 or from 0 to 1.
PARITY CHECK
One bit, called parity bit is added to every data unit so that the total number
of 1’s in the data unit becomes even (or) odd.
The source then transmits this data via a link, and bits are checked andverified at
the destination.
Data is considered accurate if the number of bits (even or odd) matches thenumber
transmitted from the source.
This techniques is the most common and least complex method.
1. Even parity – Maintain even number of 1sE.g., 1011 → 1011 1
2. Odd parity – Maintain odd number of 1s
E.g., 1011 → 1011 0
Steps Involved :
Consider the original message (dataword) as M(x) consisting of ‘k’ bits and
the divisor as C(x) consists of ‘n+1’ bits.
The original message M(x) is appended by ‘n’ bits of zero’s. Let us call
this zero-extended message as T(x).
Divide T(x) by C(x) and find the remainder.
The division operation is performed using XOR operation.
The resultant remainder is appended to the original message M(x) as CRCand sent by
the sender(codeword).
Example 1:
Consider the Dataword / Message M(x) = 1001
Divisor C(x) = 1011 (n+1=4)
Appending ‘n’ zeros to the original Message M(x).
The resultant messages is called T(x) = 1001 000. (here n=3)
Divide T(x) by the divisor C(x) using XOR operation.
Sender Side :
Receiver Side:
(For Both Case – Without Error and With Error)
Polynomials
A pattern of 0s and 1s can be represented as a polynomial with coefficientsof 0 and 1.
The power of each term shows the position of the bit; the coefficient showsthe value of
the bit.
INTERNET CHECKSUM
ERROR CONTROL
STOP-AND-WAIT ARQ
Stop-and-wait ARQ is a technique used to retransmit the data in case of damaged or lost
frames.
This technique works on the principle that the sender will not transmit the next frame
until it receives the acknowledgement of the last transmitted frame.
o Damaged Frame: When the receiver receives a damaged frame(i.e., the frame contains
an error), then it returns the NAK frame. For example, whenthe frame DATA 1 is sent, and
then the receiver sends the ACK 0 frame means that the data 1 has arrived correctly. The sender
transmits the next frame: DATA 0. It reaches undamaged, and the receiver returns ACK 1.
The sender transmits the third frame: DATA 1. The receiver reports an error and returns the
NAK frame. The sender retransmits the DATA 1 frame.
o Lost Frame: Sender is equipped with the timer and starts when the frame istransmitted.
Sometimes the frame has not arrived at the receiving end so that it cannot be acknowledged
either positively or negatively. The sender waits for acknowledgement until the timer goes off.
If the timer goes off, it retransmits the last transmitted frame.
SLIDING WINDOW ARQ
Sliding Window ARQ is a technique used for continuous transmission error control.
1. GO-BACK-N ARQ
o In Go-Back-N ARQ protocol, if one frame is lost or damaged, then itretransmits
all the frames after which it does not receive the positive ACK.
o In the above figure, three frames (Data 0,1,2) have been transmitted beforean error
discovered in the third frame.
o The receiver discovers the error in Data 2 frame, so it returns the NAK 2frame.
o All the frames including the damaged frame (Data 2,3,4) are discarded as itis transmitted
after the damaged frame.
o Therefore, the sender retransmits the frames (Data2,3,4).
2. SELECTIVE-REJECT(REPEAT) ARQ
The non-persistent approach reduces the chance of collision because it is unlikely that two or
more stations will wait the same amount of time and retry to send simultaneously.
However, this method reduces the efficiency of the network because the medium
remains idle when there may be stations with frames to send.
Persistent Strategy
1- Persistent :
The 1-persistent method is simple and straightforward.
In this method, after the station finds the line idle, it sends its frameimmediately (with
probability 1).
This method has the highest chance of collision because two or more stations may find
the line idle and send their frames immediately.
P-Persistent :
In this method, after the station finds the line idle it follows these steps:
With probability p, the station sends its frame.
With probability q = 1 − p, the station waits for the beginning of the next time slot
and checks the line again.
The p-persistent method is used if the channel has time slots with a slot duration equal
to or greater than the maximum propagation time.
The p-persistent approach combines the advantages of the other two strategies. It
reduces the chance of collision and improves efficiency.
EXPONENTIAL BACK-OFF
Once an adaptor has detected a collision and stopped its transmission, it waits a certain
amount of time and tries again.
Each time it tries to transmit but fails, the adaptor doubles the amount of time it waits
before trying again.
This strategy of doubling the delay interval between each retransmission attempt is a
general technique known as exponential back-off.
CARRIER SENSE MULTIPLE ACCESS / COLLISION AVOIDANCE(CSMA/CA)
Carrier sense multiple access with collision avoidance (CSMA/CA) was invented for
wireless networks.
Wireless protocol would follow exactly the same algorithm as the Ethernet—Wait until
the link becomes idle before transmitting and back off should a collision occur.
Collisions are avoided through the use of CSMA/CA’s three strategies: the interframe
space, the contention window, and acknowledgments
Interframe Space (IFS) - First, collisions are avoided by deferring transmission even if the
channel is found idle. When an idle channel is found, the station does not send immediately. It
waits for a period of time called the interframe space or IFS.
Contention Window - The contention window is an amount of time divided into slots. A
station that is ready to send chooses a random number of slots as its wait time. The number of
slots in the window changes according to the binary exponential backoff strategy. This means
that it is set to one slot the first time and then doubles each time the station cannot detect an
idle channel after the IFS time.
Acknowledgment - In addition, the data may be corrupted during the transmission. The
positive acknowledgment and the time-out timer can help guarantee that the receiver has
received the frame.
EVOLUTION OF ETHERNET
Standard Ethernet (10 Mbps)
The original Ethernet technology with the data rate of 10 Mbps as the Standard Ethernet.
Standard Ethernet types are
1. 10Base5: Thick Ethernet,
2. 10Base2: Thin Ethernet ,
3. 10Base-T: Twisted-Pair Ethernet
4. 10Base-F: Fiber Ethernet.
The 64-bit preamble allows the receiver to synchronize with the signal; it is a sequence
of alternating 0’s and 1’s.
Both the source and destination hosts are identified with a 48-bit address.
The packet type field serves as the demultiplexing key.
Each frame contains up to 1500 bytes of data(Body).
CRC is used for Error detection
Ethernet Addresses
Every Ethernet host has a unique Ethernet address (48 bits – 6 bytes).
Ethernet address is represented by sequence of six numbers separated bycolons.
Each number corresponds to 1 byte of the 6 byte address and is given by pair of
hexadecimal digits.
Eg: 8:0:2b:e4:b1:2 is the representation of
00001000 00000000 00101011 11100100 10110001 00000010
Each frame transmitted on an Ethernet is received by every adaptor connected to the
Ethernet.
In addition to unicast addresses an Ethernet address consisting of all 1s istreated as
broadcast address.
Similarly the address that has the first bit set to 1 but it is not the broadcast address is
called multicast address.
ADVANTAGES OF ETHERNET
Ethernets are successful because
It is extremely easy to administer and maintain. There are no switches thatcan fail, no
routing or configuration tables that have to be kept up-to-date, and it is easy to add a new
host to the network.
It is inexpensive: Cable is cheap, and the only other cost is the networkadaptor on each
host.
3. WIRELESS LAN ( IEEE 802.11)
Wireless communication is one of the fastest-growing technologies.
The demand for connecting devices without the use of cables is increasing everywhere.
Wireless LANs can be found on college campuses, in office buildings, and in many
public areas.
Station Types
IEEE 802.11 defines three types of stations based on their mobility in a wireless
LAN:
1. No-transition - A station with no-transition mobility is either stationary (not moving)
or moving only inside a BSS.
2. BSS-transition - A station with BSS-transition mobility can move from one BSS
to another, but the movement is confined inside one ESS
3. ESS-transition - A station with ESS-transition mobility can move from one ESS to
another.
Each of the four nodes is able to send and receive signals that reach just the nodes to its
immediate left and right.
For example, B can exchange frames with A and C but it cannot reach D,while C can
reach B and D but not A.
Suppose B is sending to A. Node C is aware of this communication because it hears B’s
transmission.
If at the same time, C wants to transmit to node D.
It would be a mistake, however, for C to conclude that it cannot transmit to anyone just
because it can hear B’s transmission.
This is not a problem since C’s transmission to D will not interfere with A’s ability to
receive from B.
This is called exposed problem.
Although B and C are exposed to each other’s signals, there is no interference if
B transmits to A while C transmits to D.
MULTIPLE ACCESS WITH COLLISION AVOIDANCE (MACA)
MACA is used to avoid collisions caused by the hidden terminal problem and exposed
terminal problem.
MACA uses short signaling packets called RTS and CTS for collision avoidance.
The RTS and CTS signals helps us to determine who else is in the transmission range
or who is busy.
When a sender wants to transmit, it sends a signal called Request-To-Send(RTS).
If the receiver allows the transmission, it replies to the sender a signal called Clear-To-
Send (CTS).
Any node that sees the CTS frame knows that it is close to the receiver, and therefore
cannot transmit for the period of time.
Any node that sees the RTS frame but not the CTS frame is not close enough to the
receiver to interfere with it, and so is free to transmit.
The Signaling packets RTS and CTS contains information such as
sender address
receiver address
length of the data to be sent/received
The receiver sends an ACK to the sender after successfully receiving aframe.
All nodes must wait for this ACK before trying to transmit.
When two or more nodes detect an idle link and try to transmit an RTS frame at the same
time, their RTS frames will collide with each other.
802.11 do not support collision detection, but instead, the senders realize the collision
has happened when they do not receive the CTS frame after a period of time.
Each node waits for a random amount of time before trying again.
The amount of time a given node delays is defined by exponential back-off algorithm.
DISTRIBUTION SYSTEM IN WLAN / 802.11
In wireless network, nodes can move freely. Some nodes are allowed to roam and some
are connected to a wired network infrastructure called access points (AP), and they are
connected to each other by a so-called distribution system.
Two nodes can communicate directly with each other if they are within reach of each
other,
When the nodes are at different range, for example when node A wish to communicate
with node E, A first sends a frame to its access point (AP-1), which forwards the frame
across the distribution system to AP-3, which finally transmits the frame to E.
Duration - contains the duration of time the medium is occupied by the nodes.
Addr l - identifies the final original destination
Addr 2 - identifies the immediate sender (the one that forwarded the frame from the
distribution system to the ultimate destination)
Addr 3 - identifies the intermediate destination (the one that accepted the frame from a
wireless node and forwarded it across the distribution system)
Addr 4 - identifies the original source
Sequence Control - to avoid duplication of frames sequence number is assigned to each
frame
Payload - Data from sender to receiver
CRC - used for Error detection of the frame
4. BLUETOOTH (IEEE 802.15.1 )
A Bluetooth is an ad hoc network, which means that the network is formed
spontaneously.
Bluetooth is a wireless LAN technology designed to connect devices of different
functions such as telephones, notebooks, computers (desktop and laptop), cameras,
printers, when they are at a short distance from each other.
Bluetooth technology is the implementation of a protocol defined by the IEEE
802.15 standard.
The standard defines a wireless personal-area network (PAN)
Bluetooth operates in the 2.4 GHz Unlicensed ISM band.
The range for Bluetooth communication is 0-30 feet (10 meters).
This distance can be increased to 100 meters by amplifying the power.
Bluetooth links have typical bandwidths around 1 to 3 Mbps.
Bluetooth is specified by an industry consortium called the Bluetooth Special Interest
Group.
Upto eight devices can be connected through Bluetooth.
One device will function as a Master and the other seven devices will function as
slaves.
Bluetooth uses Frequency Hopping Spread Spectrum (FHSS) to avoid any
interference.
Bluetooth supports two kinds of links:
Asynchronous Connectionless (ACL) links - for data
Synchronous Connection oriented (SCO) links - for audio/voice
BLUETOOTH ARCHITECTURE
Bluetooth defines two types of networks: Piconet and Scatternet.
PICONET
The basic Bluetooth network configuration is called a Piconet
A Piconet is a collection of eight bluetooth devices which are synchronized.
One device in the piconet can act as Primary (Master), all other devicesconnected to
the master act as Secondary (Slaves).
All the secondary stations synchronize their clocks and hopping sequencewith the
primary.
Any communication is between the primary/master and a secondary/slave.
The communication between the primary and secondary stations can be one-to-one or
one-to-many.
The slaves do not communicate directly with each other.
The devices in a piconet can be in any one of the three types/states.
They are
Active Device / State
1. Connected to the piconet and participates in the communication.
2. Can be a Master or a Slave device.
3. All active devices are assigned a 3-bit address (AMA).
Parked Device / State
1. Connected to the piconet, but does not actively participate in the communication.
2. More than 200 devices can be parked.
3. All parked devices use an 8-bit parked member address (PMA).
Stand-by Device / State
1. Not connected to the piconet.
2. They do not participate in the piconet currently but may take part at a later time.
3. Devices in stand-by do not need an address.
If a parked device wants to communicate and there are already seven active slaves, one
slave has to switch to park state to allow the parked device to switch to active state.
SCATTERNET
Piconets can be combined to form what is called a scatternet.
Many piconets with overlapping coverage can exist simultaneously, called Scatternet.
A secondary station in one piconet can be the primary in another piconet.
This station can receive messages from the primary in the first piconet (as a secondary)
and, acting as a primary, deliver them to secondaries in the second piconet.
A station can be a member of two piconets.
In the example given below, there are two piconets, in which one slave participates
in two different piconets.
Master of one piconet cannot act as the master of another piconet.
But the Master of one piconet can act as a Slave in another piconet
BLUETOOTH LAYERS
Radio Layer
The radio layer is roughly equivalent to the physical layer of the Internet model.
Bluetooth uses the frequency-hopping spread spectrum (FHSS) method in the
physical layer to avoid interference from other devices or othernetworks.
Bluetooth hops 1600 times per second, which means that each device changes its
modulation frequency 1600 times per [Link] transform bits to a signal, Bluetooth
uses a sophisticated version of FSK,called GFSK.
Baseband Layer
The baseband layer is roughly equivalent to the MAC sublayer in LANs.
The access method is TDMA.
The primary and secondary stations communicate with each other using time slots.
The length of a time slot is exactly 625 µs.
During that time, a primary sends a frame to a secondary, or a secondary sends a
frame to the primary.
L2CAP
The Logical Link Control and Adaptation Protocol, or L2CAP (L2 heremeans LL)
is equivalent to the LLC sublayer in LANs.
It is used for data exchange on an ACL link.
The L2CAP functions are: multiplexing, segmentation and reassembly, quality of
service (QoS), and group management.
5. SWITCHING
o The technique of transferring the information from one computer network to another
network is known as switching.
o Switching in a computer network is achieved by using switches.
o A switch is a small hardware device which is used to join multiple computers
together with one local area network (LAN).
o Switches are devices capable of creating temporary connections between two ormore
devices linked to the switch.
o Switches are used to forward the packets based on MAC addresses.
o 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.
o It is operated in full duplex mode.
o It does not broadcast the message as it works with limited bandwidth.
Advantages of Switching:
o Switch increases the bandwidth of the network.
o It reduces the workload on individual PCs as it sends the information to only that device
which has been addressed.
o It increases the overall performance of the network by reducing the traffic on the
network.
o There will be less frame collision as switch creates the collision domain for each
connection.
Disadvantages of Switching:
o A Switch is more expensive than network bridges.
o A Switch cannot determine the network connectivity issues easily.
o Proper designing and configuration of the switch are required to handle multicast
packets.
Types of Switching Techniques
CIRCUIT SWITCHING
2. Data transfer - Once the circuit has been established, data and voice are transferred from
the source to the destination. The dedicated connection remains as long as the end parties
communicate.
Advantages
It is suitable for long continuous transmission, since a continuous transmission route
is established, that remains throughout the conversation.
The dedicated path ensures a steady data rate of communication.
No intermediate delays are found once the circuit is established. So, they are
suitable for real time communication of both voice and data transmission.
Disadvantages
Circuit switching establishes a dedicated connection between the end parties. This
dedicated connection cannot be used for transmitting any other data, even if the data load
is very low.
Bandwidth requirement is high even in cases of low data volume.
There is underutilization of system resources. Once resources are allocated to a particular
connection, they cannot be used for other connections.
Time required to establish connection may be high.
It is more expensive than other switching techniques as a dedicated path isrequired for
each connection.
PACKET SWITCHING
o The packet switching is a switching technique in which the message is sent in onego,
but it is divided into smaller pieces, and they are sent individually.
o The message splits into smaller pieces known as packets and packets are given aunique
number to identify their order at the receiving end.
o Every packet contains some information in its headers such as source address,
destination address and sequence number.
o Packets will travel across the network, taking the shortest path as possible.
o All the packets are reassembled at the receiving end in correct order.
o If any packet is missing or corrupted, then the message will be sent to resend the
message.
o If the correct order of the packets is reached, then the acknowledgment message will
be sent.
Advantages of Packet Switching:
o 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.
o Reliable: If any node is busy, then the packets can be rerouted. This ensures that the
Packet Switching technique provides reliable communication.
o 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.
Routing Table
In this type of network, each switch (or packet switch) has a routing table which is based
on the destination address. The routing tables are dynamic and are updated periodically. The
destination addresses and the corresponding forwarding output ports are recorded in the tables.
PACKET SWITCHING
CIRCUIT
SWITCHING Virtual Circuit Switching Datagram Switching
A dedicated path exists for A dedicated path exists for data No dedicated path exists for
data transfer transfer data transfer
All the packets take the All the packets take the same All the packets may not take
same path path the same path
Implemented at physical
layer Implemented at data linklayer Implemented at network layer
Inefficient in terms of Provides better efficiency than Provides better efficiency than
resource utilization circuit switched systems message switched systems
Example- Telephone
systems Examples- X.25, Framerelay Example- Internet
MESSAGE SWITCHING
BRIDGES
Transparent Bridges
These are the bridge in which the stations are completely unaware of the bridge’s
existence i.e. whether or not a bridge is added or deleted from the network , reconfiguration of
the stations is unnecessary.
Source Routing Bridges
In these bridges, routing operation is performed by source station and the frame
specifies which route to follow.
Translation Bridges
These bridges connect networks with different architectures, such as Ethernet and Token
Ring. These bridges appear as:
– Transparent bridges to an Ethernet host
– Source-routing bridges to a Token Ring host
6. IP - INTERNET PROTOCOL
IP runs on all the nodes (both hosts and routers) in a collection of networks
IP defines the infrastructure that allows these nodes and networks to function as a single
logical internetwork.
IP SERVICE MODEL
Service Model defines the host-to-host services that we want to provide
The main concern in defining a service model for an internetwork is that we can provide
a host-to-host service only if this service can somehow be provided over each of the
underlying physical networks.
The Internet Protocol is the key tool used today to build scalable, heterogeneous
internetworks.
The IP service model can be thought of as having two parts:
A GLOBAL ADDRESSING SCHEME - which provides a way to
identify all hosts in the internetwork
A DATAGRAM DELIVERY MODEL – A connectionless model of datadelivery.
FIELD DESCRIPTION
Version Specifies the version of IP. Two versions exists – IPv4 and IPv6.
HLen Specifies the length of the header
TOS An indication of the parameters of the quality of servicedesired
(Type of Service) such as Precedence, Delay, Throughput and Reliability.
Length Length of the entire datagram, including the header. The maximum
size of an IP datagram is 65,535(210 )bytes
Ident Uniquely identifies the packet sequence [Link] for
(Identification) fragmentation and re-assembly.
Example:
The original packet starts at the client; the fragments are reassembled at theserver.
The value of the identification field is the same in all fragments, as is the value of the
flags field with the more bit set for all fragments except the last.
Also, the value of the offset field for each fragment is shown.
Although the fragments arrived out of order at the destination, they can becorrectly
reassembled.
The value of the offset field is always relative to the original datagram.
Even if each fragment follows a different path and arrives out of order, the final
destination host can reassemble the original datagram from thefragments received
(if none of them is lost) using the following strategy:
1) The first fragment has an offset field value of zero.
2) Divide the length of the first fragment by 8. The second fragment has an offset value
equal to that result.
3) Divide the total length of the first and second fragment by 8. The third fragment
has an offset value equal to that result.
4) Continue the process. The last fragment has its M bit set to 0.
5) Continue the process. The last fragment has a more bit value of 0.
Reassembly:
Reassembly is done at the receiving host and not at each router.
To enable these fragments to be reassembled at the receiving host, they allcarry the
same identifier in the Ident field.
This identifier is chosen by the sending host and is intended to be uniqueamong all
the datagrams that might arrive at the destination from this source over some
reasonable time period.
Since all fragments of the original datagram contain this identifier, thereassembling
host will be able to recognize those fragments that go together.
For example, if a single fragment is lost, the receiver will still attempt to reassemble the
datagram, and it will eventually give up and have to garbage-collect the resources that
were used to perform the failed reassembly.
Hosts are now strongly encouraged to perform “path MTU discovery,” a process by
which fragmentation is avoided by sending packets that are smallenough to traverse
the link with the smallest MTU in the path from sender toreceiver.
IP SECURITY
There are three security issues that are particularly applicable to the IP protocol:
(1) Packet Sniffing (2) Packet Modification and (3) IP Spoofing.
Packet Sniffing
An intruder may intercept an IP packet and make a copy of it.
Packet sniffing is a passive attack, in which the attacker does not change the contents
of the packet.
This type of attack is very difficult to detect because the sender and the receiver may
never know that the packet has been copied.
Although packet sniffing cannot be stopped, encryption of the packet can make the
attacker’s effort useless.
The attacker may still sniff the packet, but the content is not detectable.
Packet Modification
The second type of attack is to modify the packet.
The attacker intercepts the packet, changes its contents, and sends the new packet
to the receiver.
The receiver believes that the packet is coming from the original sender.
This type of attack can be detected using a data integrity mechanism.
The receiver, before opening and using the contents of the message, can use this
mechanism to make sure that the packet has not been changed during the transmission.
IP Spoofing
An attacker can masquerade as somebody else and create an IP packet that carries
the source address of another computer.
An attacker can send an IP packet to a bank pretending that it is coming from one of
the customers.
This type of attack can be prevented using an origin authentication mechanism
IP Sec
The IP packets today can be protected from the previously mentioned attacks using a
protocol called IPSec (IP Security).
This protocol is used in conjunction with the IP protocol.
IPSec protocol creates a connection-oriented service between two entities in which
they can exchange IP packets without worrying about the three attacks such as Packet
Sniffing, Packet Modification and IP Spoofing.
IP Sec provides the following four services:
1) Defining Algorithms and Keys : The two entities that want to create a secure channel
between themselves can agree on some available algorithms and keys to be used for
security purposes.
2) Packet Encryption : The packets exchanged between two parties can be encrypted
for privacy using one of the encryption algorithms and a shared key agreed upon in
the first step. This makes the packet sniffing attack useless.
3) Data Integrity : Data integrity guarantees that the packet is not modified during the
transmission. If the received packet does not passthe data integrity test, it is
[Link] prevents the second attack,packet modification.
4) Origin Authentication : IPSec can authenticate the origin of the packet to be sure
that the packet is not created by an imposter. This canprevent IP spoofing attacks.
7. ADDRESS RESOLUTION PROTOCOL (ARP)
o ARP stands for Address Resolution Protocol.
o ARP is the most important protocol of the Data Link Layer.
o ARP is a network layer protocol used to convert a IP address (Network/Logical
address) into a MAC Address (Hardware /Physical address).
A DHCP packet is actually sent using a protocol called the User Datagram Protocol
(UDP).
9. ICMPV4 - INTERNET CONTROL MESSAGE PROTOCOL VERSION 4
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 isunable 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.
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
ICMP DEBUGGING TOOLS
Two tools are used for debugging purpose. They are (1) Ping (2) Traceroute
Ping
The ping program is used to find if a host is alive and responding.
The source host sends ICMP echo-request messages; the destination, if alive, responds
with ICMP echo-reply messages.
The ping program sets the identifier field in the echo-request and echo-reply message
and starts the sequence number from 0; this number is incremented by1 each time a new
message is sent.
The ping program can calculate the round-trip time.
It inserts the sending time in the data section of the message.
When the packet arrives, it subtracts the arrival time from the departure time to get the
round-trip time (RTT).
$ ping [Link]
Traceroute or Tracert
The traceroute program in UNIX or tracert in Windows can be used to trace the path
of a packet from a source to the destination.
It can find the IP addresses of all the routers that are visited along the path.
The program is usually set to check for the maximum of 30 hops (routers) to be visited.
The number of hops in the Internet is normally less than this.
$ traceroute [Link]
Unit – 3 Routing and Routing Protocols
Routing - RIP - OSPF - IGRP - EIGRP - Metrics - Switch Basics - Global
Internet - Domains - BGP - IPv6 - Multicast Communication -IP addresses
- Address Classes – Subnetting – Supernetting – Examples - Multicast
Routing – DVMRP - PIM. RFC-IPV6 and OSPF.
Routing
Routing is the process of selecting best paths in a network.
Routing a packet from its source to its destination means routing the packet from
a source router (the default router of the source host) to a destination router (the
router connected to the destination network).
There are two processes inside router:
a) One of them handles each packet as it arrives, looking up the outgoing line to
use for it in the routing table. This process is forwarding.
b) The other process is responsible for filling in and updating the routing tables.
That is where the routing algorithm comes into play. This process is routing.
The source host needs no forwarding table because it delivers its packet to the default
router in its local network.
The destination host needs no forwarding table either because it receives the packet
from its default router in its local network.
Only the intermediate routers in the networks need forwarding tables.
The basic problem of routing is to find the lowest-cost path between any two nodes,
where the cost of a path equals the sum of the costs of all the edges thatmake up the
path.
This static approach has several problems:
• It does not deal with node or link failures.
• It does not consider the addition of new nodes or links.
• It implies that edge costs cannot change.
For these reasons, routing is achieved by running routing protocols among the nodes.
These protocols provide a distributed, dynamic way to solve the problem of finding
the lowest-cost path in the presence of link and node failures andchanging edge
costs.
The forwarding table is used when a packet is being forwarded and so must contain
enough information to accomplish the forwarding function.
This means that a row in the forwarding table contains the mapping from a network
prefix to an outgoing interface and some MAC information, such as the Ethernet
address of the next hop.
The routing table, on the other hand, is the table that is built up by the routing
algorithms as a precursor to building the forwarding table.
It generally contains mappings from network prefixes to next hops.
It may also contain information about how this information was learned, so that the
router will be able to decide when it should discard some information.
Whether the routing table and forwarding table are actually separate data structures
is something of an implementation choice, but there are numerous reasons to keep
them separate.
For example, the forwarding table needs to be structured to optimize the process of
looking up an address when forwarding a packet, while the routing table needs to
be optimized for the purpose of calculating changes in topology.
In many cases, the forwarding table may even be implemented in specialized
hardware, whereas this is rarely if ever done for the routing table.
NETWORK AS A GRAPH
The Figure below shows a graph representing a network.
The nodes of the graph, labeled A through G, may be hosts, switches, routers,or
networks.
The edges of the graph correspond to the network links.
Each edge has an associated cost , which gives some indication of the desirability
of sending traffic over that link.
The basic problem of routing is to find the lowest-cost path between any two nodes,
where the cost of a path equals the sum of the costs of all the edges that make up
the path. Such a static approach has several shortcomings:
o It does not deal with node or link failures.
o It does not consider the addition of new nodes or links.
o It implies that edge costs cannot change, even though we might reasonably
wish to have link costs change over time (e.g., assigning high cost to a link
that is heavily loaded).
o For these reasons, routing is achieved in most practical networks by running
routing protocols among the nodes. These protocols provide a distributed,
dynamic way to solve the problem of finding the lowest-cost path in the
presence of link and node failures and changing edge costs.
Unicast Routing Algorithms
There are three main classes of routing protocols:
1) Distance Vector Routing Algorithm – Routing Information Protocol
2) Link State Routing Algorithm – Open Shortest Path First Protocol
3) Path-Vector Routing Algorithm - Border Gateway Protocol
DISTANCE VECTOR ROUTING
Distance vector routing is distributed, i.e., algorithm is run on all nodes.
Each node knows the distance (cost) to each of its directly connected neighbors.
Nodes construct a vector (Destination, Cost, NextHop) and distributes to its
neighbors.
Nodes compute routing table of minimum distance to every other node via
NextHop using information obtained from its neighbors.
Initial State
Each node sends its initial table (distance vector) to neighbors and receivestheir
estimate.
Node A sends its table to nodes B, C, E & F and receives tables from nodes B,C, E
& F.
Each node updates its routing table by comparing with each of its neighbor's table
For each destination, Total Cost is computed as:
Total Cost = Cost (Node to Neighbor) + Cost (Neighbor to Destination)
If Total Cost < Cost then
Cost = Total Cost and NextHop = Neighbor
Node A learns from C's table to reach node D and from F's table to reach node G.
Total Cost to reach node D via C = Cost (A to C) + Cost(C to D)
Cost = 1 + 1 = 2.
Since 2 < ∞, entry for destination D in A's table is changed to (D, 2, C)
Total Cost to reach node G via F = Cost(A to F) + Cost(F to G) = 1 + 1 = 2
Since 2 < ∞, entry for destination G in A's table is changed to (G, 2, F)
Each node builds complete routing table after few exchanges amongst its neighbors.
System stabilizes when all nodes have complete routing information, i.e.,
convergence.
Routing tables are exchanged periodically or in case of triggered update.
The final distances stored at each node is given below:
Example
Routers advertise the cost of reaching networks. Cost of reaching each link is 1
hop. For example, router C advertises to A that it can reach network 2, 3 at cost0
(directly connected), networks 5, 6 at cost 1 and network 4 at cost 2.
Each router updates cost and next hop for each network number.
Infinity is defined as 16, i.e., any route cannot have more than 15 hops.
Therefore RIP can be implemented on small-sized networks only.
Advertisements are sent every 30 seconds or in case of triggered update.
Command - It indicates the packet type. Value 1 represents a request packet. Value 2
represents a response packet.
Version - It indicates the RIP version number. For RIPv1, the value is 0x01.
Address Family Identifier - When the value is 2, it represents the IP protocol.
IP Address - It indicates the destination IP address of the route. It can be the
addresses of only the natural network segment.
Metric - It indicates the hop count of a route to its destination.
Count-To-Infinity (or) Loop Instability Problem
Suppose link from node A to E goes down.
Node A advertises a distance of ∞ to E to its neighbors
Node B receives periodic update from C before A’s update reaches B
Node B updated by C, concludes that E can be reached in 3 hops via C
Node B advertises to A as 3 hops to reach E
Node A in turn updates C with a distance of 4 hops to E and so on
Thus nodes update each other until cost to E reaches infinity, i.e., no convergence.
Routing table does not stabilize.
This problem is called loop instability or count to infinity
Solution to Count-To-Infinity (or) Loop Instability Problem :
Infinity is redefined to a small number, say 16.
Distance between any two nodes can be 15 hops maximum. Thus distancevector
routing cannot be used in large networks.
When a node updates its neighbors, it does not send those routes it learned from
each neighbor back to that neighbor. This is known as split horizon.
Split horizon with poison reverse allows nodes to advertise routes it learnt from a
node back to that node, but with a warning message
LINK STATE ROUTING (LSR)
Each node knows state of link to its neighbors and cost.
Nodes create an update packet called link-state packet (LSP) that contains:
ID of the node
List of neighbors for that node and associated cost
64-bit Sequence number
Time to live
Link-State routing protocols rely on two mechanisms:
Reliable flooding of link-state information to all other nodes
Route calculation from the accumulated link-state knowledge
Reliable Flooding
Each node sends its LSP out on each of its directly connected links.
When a node receives LSP of another node, checks if it has an LSP already for that
node.
If not, it stores and forwards the LSP on all other links except the incoming one.
Else if the received LSP has a bigger sequence number, then it is stored and
forwarded. Older LSP for that node is discarded.
Otherwise discard the received LSP, since it is not latest for that node
Thus recent LSP of a node eventually reaches all nodes, i.e., reliable flooding.
Each AS have a border router (gateway), by which packets enter and leave that AS.
In above figure, R3 and R4 are border routers.
One of the router in each autonomous system is designated as BGP speaker.
BGP Speaker exchange reachability information with other BGP speakers, known
as external BGP session.
BGP advertises complete path as enumerated list of AS (path vector) to reach a
particular network.
Paths must be without any loop, i.e., AS list is unique.
For example, backbone network advertises that networks 128.96 and 192.4.153 can
be reached along the path <AS1, AS2, AS4>.
If there are multiple routes to a destination, BGP speaker chooses one based on
policy.
Speakers need not advertise any route to a destination, even if one exists.
Advertised paths can be cancelled, if a link/node on the path goes down. This
negative advertisement is known as withdrawn route.
Routes are not repeatedly sent. If there is no change, keep alive messages are sent.
GLOBAL UNICAST
Large chunks (87%) of address space are left unassigned for future use.
IPv6 defines two types of local addresses for private networks.
o Link local - enables a host to construct an address that
need not beglobally unique.
o Site local - allows valid local address for use in a isolated site
withseveral subnets.
Reserved addresses start with prefix of eight 0's.
o Unspecified address is used when a host does not know its
address
o Loopback address is used for testing purposes before
connecting
o Compatible address is used when IPv6 hosts uses IPv4
network
o Mapped address is used when a IPv6 host communicates with a IPv4 host
IPv6 defines any cast address, assigned to a set of interfaces.
Packet with any cast address is delivered to only one of the nearest interface.
ADDRESS NOTATION OF IPV6
Standard representation of IPv6 address is x : x : x : x : x : x : x : x where x is a16-
bit hexadecimal address separated by colon (:).
For example,
47CD : 1234 : 4422 : ACO2 : 0022 : 1234 : A456 : 0124
IPv4 address is mapped to IPv6 address by prefixing the 32-bit IPv4 address
with 2 bytes of 1s and then zero-extending the result to 128 bits.
For example,
128. 96.33.81 → : : FFFF : [Link]
This notation is called as CIDR notation or slash notation.
ADDRESS AGGREGATION OF IPV6
IPv6 provides aggregation of routing information to reduce the burden onrouters.
Aggregation is done by assigning prefixes at continental level.
For example, if all addresses in Europe have a common prefix, then routers in other
continents would need one routing table entry for all networks in Europe.
Hop-by-Hop — source host passes information to all routers visited by the packet
Destination — source host information is passed to the destination only.
Source Routing — routing information provided by the source host.
Fragmentation — In IPv6, only the source host can fragment. Source uses a path
MTU discovery technique to find smallest MTU on the path.
Authentication — used to validate the sender and ensures data integrity.
ESP (Encrypted Security Payload) — provides confidentiality against eavesdropping
ADVANCED CAPABILITIES OF IPV6
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.
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.
Dual-Stack Operation and Tunneling
In dual-stack, nodes run both IPv6 and IPv4, uses Version field to decide which stack
should process an arriving packet.
IPv6 packet is encapsulated with an IPv4 packet as it travels through an IPv4
network. This is known as tunneling and packet contains tunnel endpoint as its
destination address.
Network Address Translation
NAT enables hosts on a network to use Internet with local addresses.
Addresses reserved for internal use range from [Link] to [Link]
Organization must have single connection to the Internet through a router that runs
the NAT software.
MULTICAST COMMUNICATION
There are, however, applications that need a broader multicasting capability
that is effective at the scale of internet works. For example, when a radio station is
broadcast over the Internet, the same data must be sent to all the hosts where a user has
tuned in to that station. In that example, the communication is one-to-many. Other
examples of one-to-many applications include transmitting the same news, current stock
prices, or software updates to multiple hosts.
There are also applications whose communication is many-to-many, such as
multimedia teleconferencing, online multiplayer gaming, or distributed simulations. In
such cases, members of a group receive data from multiple senders, typically each other.
From any particular sender, they all receive the same data.
Normal IP communication, in which each packet must be addressed and sent
to a single host, is not well suited to such applications. If an application has data to send to
a group, it would have to send a separate packet with the identical data to each member of
the group. This redundancy consumes more bandwidth than necessary.
The redundant traffic is not distributed evenly but rather is focused around the
sending host, and may easily exceed the capacity of the sending host and the nearby
networks and routers.
To better support many-to-many and one-to-many communication, IP provides
an IP-level multicast analogous to the link-level multicast provided by multi-access
networks like Ethernet The basic IP multicast model is a many-to-many model based on
multicast groups, where each group has its own IP multicast address. The hosts that are
members of a group receive copies of any packets sent to that group’s multicast address. A
host can be in multiple groups, and it can join and leave groups freely by telling its local
router using a protocol.
The multicast addresses are associated with an abstract group, the membership
of which changes dynamically over time. Further, the original IP multicast service model
allows any host to send multicast traffic to a group; it doesn’t have to be a member of the
group, and there may be any number of such senders to a given group. Using IP multicast
to send the identical packet to each member of the group, a host sends a single copy of the
packet addressed to the group’s multicast address. The sending host doesn’t need to know
the individual unicast IP address of each member of the group. Similarly, the sending host
doesn’t need to send multiple copies of the packet because the routers will make copies
whenever they have to forward the packet over more than one link.
IP multicast is more scalable because it eliminates the redundant traffic
(packets) that would have been sent many times over the same links, especially those near
to the sending host.
IP’s original many-to-many multicast has been supplemented with support for
a form of one-to-many multicast. In this model of one-to-many multicast, called Source-
Specific Multicast (SSM), a receiving host specifies both a multicast group and a specific
sending host. The receiving host would then receive multicasts addressed to the specified
group, but only if they are from the specified sender. Many Internet multicast applications
(e.g., radio broadcasts) fit the SSM model. To contrast it with SSM, IP’s original many-to-
many model is sometimes referred to as Any Source Multicast (ASM).
A host signals its desire to join or leave a multicast group by communicating
with its local router using a special protocol for just that purpose. In IPv4, that protocol is
the Internet Group Management Protocol (IGMP); in IPv6, it is Multicast Listener
Discovery (MLD).
IPV4 ADDRESSES
The identifier used in the IP layer of the TCP/IP protocol suite to identify the
connection of each device to the Internet is called the Internet address or IP address.
Internet Protocol version 4 (IPv4) is the fourth version in the development of the
Internet Protocol (IP) and the first version of the protocol to be widely deployed.
IPv4 is described in IETF publication in September 1981.
The IP address is the address of the connection, not the host or the router. An IPv4
address is a 32-bit address that uniquely and universally defines the connection.
If the device is moved to another network, the IP address may be changed.
IPv4 addresses are unique in the sense that each address defines one, and only one,
connection to the Internet.
If a device has two connections to the Internet, via two networks, it has two IPv4
addresses.
IPv4 addresses are universal in the sense that the addressing system must be
accepted by any host that wants to be connected to the Internet.
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 2b because each
bit can have two different values (0 or 1).
IPv4 uses 32-bit addresses, which means that the address space is 232 or
4,294,967,296 (more than four billion).
4 billion devices could be connected to the Internet.
IPV4 ADDRESS NOTATION
There are three common notations to show an IPv4 address:
(i) binary notation (base 2),
(ii) dotted-decimal notation (base 256), and
(iii) hexadecimal notation (base 16).
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 = 214 = 16384 network address
The total number of hosts in Class B = 216 - 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 = 28 - 2 = 254 host address
Class D
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.
The reason that classful addressing has become obsolete is address depletion.
Since the addresses were not distributed properly, the Internet was faced with the
problem of the addresses being rapidly used up.
This results in no more addresses available for organizations and individuals that
needed to be connected to the Internet.
To understand the problem, let us think about class A.
This class can be assigned to only 128 organizations in the world, but each
organization needs to have a single network with 16,777,216 nodes.
Since there may be only a few organizations that are this large, most of the
addresses in this class were wasted (unused).
Class B addresses were designed for midsize organizations, but many of the
addresses in this class also remained unused.
Class C addresses have a completely different flaw in design. The number of
addresses that can be used in each network (256) was so small that most
companies were not comfortable using a block in this address class.
Class E addresses were almost never used, wasting the whole class.
Advantage of Classful Addressing
Although classful addressing had several problems and became obsolete, it had one
advantage.
Given an address, we can easily find the class of the address and, since the
prefix length for each class is fixed, we can find the prefix length immediately.
In other words, the prefix length in classful addressing is inherent in the address;
no extra information is needed to extract the prefix and the suffix.
For example , [Link] /24 represents the IP address [Link] and, its
subnet mask [Link], which has 24 leading 1-bits.
Address Aggregation
One of the advantages of the CIDR strategy is address aggregation (sometimes
called address summarization or route summarization).
When blocks of addresses are combined to create a larger block, routing can be done
based on the prefix of the larger block.
ICANN assigns a large block of addresses to an ISP.
Each ISP in turn divides its assigned block into smaller sub blocks and grants the
sub blocks to its customers.
In multicasting, a multicast router may have to send out copies of the same
datagram through more than one interface.
Hosts that are members of a group receive copies of any packets sent to that group’s
multicast address
A host can be in multiple groups
A host can join and leave groups
A host signals its desire to join or leave a multicast group by communicating with
its local router using a special protocol.
In IPv4, the protocol is Internet Group Management Protocol (IGMP)
In IPv6, the protocol is Multicast Listener Discovery (MLD)
IGMP OR MLD PROTOCOL
Hosts communicate their desire to join / leave a multicast group to a router using
Internet Group Message Protocol (IGMP) in IPv4 or Multicast Listener Discovery
(MLD) in IPv6.
Provides multicast routers with information about the membership status of hosts
connected to the network.
Enables a multicast router to create and update list of loyal members for each
group.
MULTICAST ADDRESSING
Multicast address is associated with a group, whose members are dynamic.
Each group has its own IP multicast address.
IP addresses reserved for multicasting are Class D in IPv4 (Class D 224.0.0.1to
[Link]), 1111 1111 prefix in IPv6.
Hosts that are members of a group receive copy of the packet sent when
destination contains group address.
MULTICASTING VERSUS MULTIPLE UNICASTING
Multicasting starts with a single packet from the source that is duplicated by the
routers. The destination address in each packet is the same for all duplicates.
Only a single copy of the packet travels between any two routers.
In multiple unicasting, several packets start from the source.
If there are three destinations, for example, the source sends three packets, each with
a different unicast destination address.
There may be multiple copies traveling between two routers
MULTICAST APPLICATIONS
Access to Distributed Databases
Information Dissemination
Teleconferencing.
Distance Learning
MULTICAST ROUTING
To support multicast, a router must additionally have multicast forwarding tables
that indicate, based on multicast address, which links to use to forward the multicast
packet.
Unicast forwarding tables collectively specify a set of paths.
Multicast forwarding tables collectively specify a set of trees - Multicast
distribution trees.
Multicast routing is the process by which multicast distribution trees are
determined.
To support multicasting, routers additionally build multicast forwarding tables.
Multicast forwarding table is a tree structure, known as multicast distribution
trees.
Internet multicast is implemented on physical networks that support broadcasting
by extending forwarding functions.
MULTICAST DISTRIBUTION TREES
There are two types of Multicast Distribution Trees used in multicast routing.
They are
Source-Based Tree: (DVMRP)
For each combination of (source, group), there is a shortest path spanning tree.
Flood and prune
Send multicast traffic everywhere
Prune edges that are not actively subscribed to group
Link-state
Routers flood groups they would like to receive
Compute shortest-path trees on demand
Shared Tree (PIM)
Single distributed tree shared among all sources
Does not include its own topology discovery mechanism, but instead uses
routing information supplied by other routing protocols
Specify rendezvous point (RP) for group
Senders send packets to RP, receivers join at RP
RP multicasts to receivers; Fix-up tree for optimization
Rendezvous-Point Tree: one router is the center of the group and therefore the
root of the tree.
MULTICAST ROUTING PROTOCOLS
Internet multicast is implemented on physical networks that support broadcasting
by extending forwarding functions.
Major multicast routing protocols are:
1. Distance-Vector Multicast Routing Protocol (DVMRP)
2. Protocol Independent Multicast (PIM)
Distance Vector Multicast Routing Protocol
Pruning:
Sent from routers receiving multicast traffic for which they have no active group
members
“Prunes” the tree created by DVMRP
Stops needless data from being sent
Grafting:
Used after a branch has been pruned back
Sent by a router that has a host that joins a multicast group
Goes from router to router until a router active on the multicast group is
reached
Sent for the following cases
A new host member joins a group
PIM divides multicast routing problem into sparse and dense mode.
PIM sparse mode (PIM-SM) is widely used.
PIM does not rely on any type of unicast routing protocol, hence protocol
independent.
Routers explicitly join and leave multicast group using Join and Prune messages.
One of the router is designated as rendezvous point (RP) for each group in a
domain to receive PIM messages.
Multicast forwarding tree is built as a result of routers sending Join messages to
RP.
Two types of trees to be constructed:
Shared tree - used by all senders
Source-specific tree - used only by a specific sending host
The normal mode of operation creates the shared tree first, followed by one or more
source-specific trees
Shared Tree
When a router sends Join message for group G to RP, it goes through a set of routers.
Join message is wildcarded (*), i.e., it is applicable to all senders.
Routers create an entry (*, G) in its forwarding table for the shared tree.
Interface on which the Join arrived is marked to forward packets for that group.
Forwards Join towards rendezvous router RP.
Eventually, the message arrives at RP. Thus a shared tree with RP as root isformed.
Example
Router R4 sends Join message for group G to rendezvous router RP.
Join message is received by router R2. It makes an entry (*, G) in its table and forwards
the message to RP.
When R5 sends Join message for group G, R2 does not forwards the Join. It adds an
outgoing interface to the forwarding table created for that group.
As routers send Join message for a group, branches are added to the tree, i.e., shared.
Multicast packets sent from hosts are forwarded to designated router RP.
Suppose router R1, receives a message to group G. oR1 has no state for group G.
o Encapsulates the multicast packet in a Register message.
o Multicast packet is tunneled along the way to RP.
RP decapsulates the packet and sends multicast packet onto the shared
tree, towards R2.
R2 forwards the multicast packet to routers R4 and R5 that have members
for group G.
Source-Specific Tree
RP can force routers to know about group G, by sending Join message to the sending
host, so that tunneling can be avoided.
Intermediary routers create sender-specific entry (S, G) in their tables. Thus a
source-specific route from R1 to RP is formed.
If there is high rate of packets sent from a sender to a group G, then shared-tree is
replaced by source-specific tree with sender as root.
Example
Analysis of PIM
Protocol independent because, tree is based on Join messages via shortest path.
Shared trees are more scalable than source-specific trees.
Source-specific trees enable efficient routing than shared trees.
Metrics
The ARPANET was the testing ground for a number of different approaches to link-cost
calculation. The original ARPANET routing metric measured the number of packets that
were queued waiting to be transmitted on each link, meaning that a link with 10 packets
queued waiting to be transmitted was assigned a larger cost weight than a link with 5
packets queued for transmission.
Using queue length as a routing metric did not work well, however, since queue length
is an artificial measure of load—it moves packets toward the shortest queue rather than
toward the destination.
The original ARPANET routing mechanism suffered from the fact that it did not take
either the bandwidth or the latency of the link into consideration.
A second version of the ARPANET routing algorithm, sometimes called the new
routing mechanism, took both link bandwidth and latency into consideration and used
delay, rather than just queue length, as a measure of load. This was done as follows. First,
each incoming packet was timestamped with its time of arrival at the router (ArrivalTime);
its departure time from the router (DepartTime) was also recorded. Second, when the link-
level ACK was received from the other side, the node computed the delay for that packet
as
Delay = (DepartTime − ArrivalTime) + TransmissionTime + Latency
where TransmissionTime and Latency were statically defined for the link.
DepartTime − ArrivalTime represents the amount of time the packet was delayed (queued)
in the node due to load. the ACK did not arrive, but instead the packet timed out, then
DepartTime was reset to the time the packet was retransmitted. In this case, DepartTime –
ArrivalTime captures the reliability of the link—the more frequent the retransmission of
packets, the less reliable the link. Under light load, it worked reasonably well, since the
two static factors of delay dominated the cost. Under heavy load, however, a congested
link would start to advertise a very high cost. This caused all the traffic to move off that
link, leaving it idle.
A third approach, called the “revised ARPANET routing metric,” addressed these
problems. The major changes were to compress the dynamic range of the metric
considerably, to account for the link type, and to smooth the variation of the metric with
time.
The smoothing was achieved by several mechanisms. First, the delay measurement
was transformed to a link utilization. Second, there was a hard limit on how much the
metric could change from one measurement cycle to the next. By smoothing the changes
in the cost, the likelihood that all nodes would abandon a route at once is greatly reduced.
The compression of the dynamic range was achieved by feeding the measured
utilization, the link type, and the link speed into a function. Observe the following:
A highly loaded link never shows a cost of more than three times its cost when idle.
The most expensive link is only seven times the cost of the least expensive.
A high-speed satellite link is more attractive than a low-speed terrestrial link.
Cost is a function of link utilization only at moderate to high loads.
The majority of real-world network deployments at the time of writing, metrics change
rarely if at all and only under the control of a network administrator. The reason for this is
partly that conventional wisdom now holds that dynamically changing metrics are too
unstable, even though this probably need not be true. Many networks today lack the great
disparity of link speeds and latencies that prevailed in the ARPANET. Thus, static metrics
are the norm. One common approach to setting metrics is to use a constant multiplied by
(1/link bandwidth).
THE GLOBAL INTERNET
Today’s Internet has hundreds of thousands of networks connected to it.
The global Internet is not just a random interconnection of Ethernets, but instead it takes
on a shape that reflects the fact that it interconnects many different organizations. Figure
4.1gives a simple depiction of the state of the Internet in 1990. Since that time, the
Internet’s topology has grown much more complex than this.
One of the salient features of this topology is that it consists of end-user sites
(e.g., Stanford University) that connect to service provider networks (e.g., BARRNET was
a provider network that served sites in the San Francisco Bay Area). In 1990, many
providers served a limited geographic region and were thus known as regional networks.
The regional networks were, in turn, connected by a nationwide backbone. In 1990, this
backbone was funded by the National Science Foundation (NSF) and was therefore called
the NSFNET backbone.
The provider networks are typically built from a large number of point-to-point links
that connect to routers; similarly, each end-user site is typically not a single network but
instead consists of multiple physical networks connected by routers and bridges.
Each provider and end-user is likely to be an administratively independent entity.
This has some significant consequences on routing. Because of this independence, each
provider’s network is usually a single autonomous system (AS).
we need to deal with two related scaling issues. The first is the scalability of routing.
We need to find ways to minimize the number of network numbers that get carried around
in routing protocols and stored in the routing tables of routers. The second is address
utilization—that is, making sure that the IP address space does not get consumed too
quickly.
Routing Areas
Internet has a million networks. Routing table entries per router should be
minimized. Link state routing protocol is used to partition domain into areas.
An routing area is a set of routers configured to exchange link-state information.
Area introduces an additional level of hierarchy. Thus domains can grow without
burdening routing protocols.
1. INTRODUCTION
The transport layer is the fourth layer of the OSI model and is the core of the Internet
model.
It responds to service requests from the session layer and issues service requests
tothe network Layer.
The transport layer provides transparent transfer of data between hosts.
It provides end-to-end control and information transfer with the quality of service
needed by the application program.
It is the first true end-to-end layer, implemented in all End Systems (ES).
Congestion Control
Congestion in a network may occur if the load on the network (the number of
packets sent to the network) is greater than the capacity of the network (the number
of packets a network can handle).
Congestion control refers to the mechanisms and techniques that control the
congestion and keep the load below the capacity.
Congestion Control refers to techniques and mechanisms that can either prevent
congestion, before it happens, or remove congestion, after it has happened
Congestion control mechanisms are divided into two categories,
1. Open loop - prevent the congestion before it happens.
2. Closed loop - remove the congestion after it happens.
Each protocol provides a different type of service and should be used appropriately.
UDP - UDP is an unreliable connectionless transport-layer protocol used for its simplicity and
efficiency in applications where error control can be provided by the application-layer process.
TCP - TCP is a reliable connection-oriented protocol that can be used in any application where
reliability is important.
SCTP - SCTP is a new transport-layer protocol designed to combine some features of UDP and
TCP in an effort to create a better protocol for multimedia communication.
[Link] DATAGRAM PROTOCOL (UDP)
UDP PORTS
Processes (server/client) are identified by an abstract locator known as port.
Server accepts message at well known port.
Some well-known UDP ports are 7–Echo, 53–DNS, 111–RPC, 161–SNMP, etc.
< port, host > pair is used as key for demultiplexing.
Ports are implemented as a message queue.
When a message arrives, UDP appends it to end of the queue.
When queue is full, the message is discarded.
When a message is read, it is removed from the queue.
When an application process wants to receive a message, one is removed from the
front of the queue.
If the queue is empty, the process blocks until a message becomes available.
UDP DATAGRAM (PACKET) FORMAT
UDP packets are known as user datagrams .
These user datagrams, have a fixed-size header of 8 bytes made of four fields, each
of 2 bytes (16 bits).
Checksum
UDP computes its checksum over the UDP header, the contents of the message
body, and something called the pseudoheader.
The pseudoheader consists of three fields from the IP header—protocol number,
source IP address, destination IP address plus the UDP length field.
Data
Data field defines tha actual payload to be transmitted.
Its size is variable.
UDP SERVICES
Process-to-Process Communication
UDP provides process-to-process communication using socket addresses, a
combination of IP addresses and port numbers.
Connectionless Services
UDP provides a connectionless service.
There is no connection establishment and no connection termination .
Each user datagram sent by UDP is an independent datagram.
There is no relationship between the different user datagrams even if they are
coming from the same source process and going to the same destination program.
The user datagrams are not numbered.
Each user datagram can travel on a different path.
Flow Control
UDP is a very simple protocol.
There is no flow control, and hence no window mechanism.
The receiver may overflow with incoming messages.
The lack of flow control means that the process using UDP should provide for this
service, if needed.
Error Control
There is no error control mechanism in UDP except for the checksum.
This means that the sender does not know if a message has been lost or duplicated.
When the receiver detects an error through the checksum, the user datagram is
silently discarded.
The lack of error control means that the process using UDP should provide for this
service, if needed.
Checksum
UDP checksum calculation includes three sections: a pseudoheader, the UDP header,
and the data coming from the application layer.
The pseudoheader is the part of the header in which the user datagram is to be
encapsulated with some fields filled with 0s.
Congestion Control
Since UDP is a connectionless protocol, it does not provide congestion control.
UDP assumes that the packets sent are small and sporadic(occasionally or at irregular
intervals) and cannot create congestion in the network.
This assumption may or may not be true, when UDP is used for interactive real-time
transfer of audio and video.
Queuing
In UDP, queues are associated with ports.
At the client site, when a process starts, it requests a port number from the operating
system.
Some implementations create both an incoming and an outgoing queue associated
with each process.
Other implementations create only an incoming queue associated with each process.
APPLICATIONS OF UDP
UDP is used for management processes such as SNMP.
UDP is used for route updating protocols such as RIP.
UDP is a suitable transport protocol for multicasting. Multicasting capability is
embedded in the UDP software
UDP is suitable for a process with internal flow and error control mechanisms such
as Trivial File Transfer Protocol (TFTP).
UDP is suitable for a process that requires simple request-response communication
with little concern for flow and error control.
UDP is normally used for interactive real-time applications that cannot tolerate
uneven delay between sections of a received message.
TCP SERVICES
Process-to-Process Communication
TCP provides process-to-process communication using port numbers.
Stream Delivery Service
TCP is a stream-oriented protocol.
TCP allows the sending process to deliver data as a stream of bytes and allows the
receiving process to obtain data as a stream of bytes.
TCP creates an environment in which the two processes seem to be connected by an
imaginary ―tube that carries their bytes across the Internet.
The sending process produces (writes to) the stream and the receiving process
consumes (reads from) it.
Full-Duplex Communication
TCP offers full-duplex service, where data can flow in both directions at the same
time.
Each TCP endpoint then has its own sending and receiving buffer, and segments
move in both directions.
Connection Establishment
While opening a TCP connection the two nodes(client and server) want to agree on a
set of parameters.
The parameters are the starting sequence numbers that is to be used for their
respective byte streams.
Connection establishment in TCP is a three-way handshaking.
1. Client sends a SYN segment to the server containing its initial sequence number (Flags
= SYN, SequenceNum = x)
2. Server responds with a segment that acknowledges client’s segment and specifies its
initial sequence number (Flags = SYN + ACK, ACK = x + 1 SequenceNum = y).
3. Finally, client responds with a segment that acknowledges server’s sequence number
(Flags = ACK, ACK = y + 1).
The reason that each side acknowledges a sequence number that is one larger than
the one sent is that the Acknowledgment field actually identifies the ―next
sequence number expected
A timer is scheduled for each of the first two segments, and if the expected
response is not received, the segment is retransmitted.
Data Transfer
After connection is established, bidirectional data transfer can take place.
The client and server can send data and acknowledgments in both directions.
The data traveling in the same direction as an acknowledgment are carried on the
same segment.
The acknowledgment is piggybacked with the data.
Connection Termination
Connection termination or teardown can be done in two ways :
Three-way Close and Half-Close
16
Send Buffer
Sending TCP maintains send buffer which contains 3 segments
(1) acknowledged data
(2) unacknowledged data
(3) data to be transmitted.
Send buffer maintains three pointers
(1) LastByteAcked, (2) LastByteSent, and (3) LastByteWritten
such that:
LastByteAcked ≤ LastByteSent ≤ LastByteWritten
A byte can be sent only after being written and only a sent byte can be
acknowledged.
Bytes to the left of LastByteAcked are not kept as it had been acknowledged.
Receive Buffer
Receiving TCP maintains receive buffer to hold data even if it arrives out-of-order.
Receive buffer maintains three pointers namely
(1) LastByteRead, (2) NextByteExpected, and (3) LastByteRcvd
such that:
LastByteRead ≤ NextByteExpected ≤ LastByteRcvd + 1
A byte cannot be read until that byte and all preceding bytes have been received.
If data is received in order, then NextByteExpected = LastByteRcvd + 1
Bytes to the left of LastByteRead are not buffered, since it is read by the application.
TCP TRANSMISSION
TCP has three mechanism to trigger the transmission of a segment.
They are
o Maximum Segment Size (MSS) - Silly Window Syndrome
o Timeout - Nagle’s Algorithm
Nagle’s Algorithm
If there is data to send but is less than MSS, then we may want to wait some amount
of time before sending the available data
If we wait too long, then it may delay the process.
If we don’t wait long enough, it may end up sending small segments resulting in
Silly Window Syndrome.
The solution is to introduce a timer and to transmit when the timer expires
Nagle introduced an algorithm for solving this problem.
TCP CONGESTION CONTROL
Congestion occurs if load (number of packets sent) is greater than capacity of the
network (number of packets a network can handle).
When load is less than network capacity, throughput increases proportionally.
When load exceeds capacity, queues become full and the routers discard some
packets and throughput declines sharply.
When too many packets are contending for the same link
o The queue overflows
o Packets get dropped
o Network is congested
Network should provide a congestion control mechanism to deal with such a
situation.
TCP maintains a variable called Congestion Window for each connection.
TCP Congestion Control mechanisms are:
Slow Start
Slow start is used to increase CongestionWindow exponentially from a cold start.
Source TCP initializes CongestionWindow to one packet.
TCP doubles the number of packets sent every RTT on successful transmission.
When ACK arrives for first packet TCP adds 1 packet to CongestionWindow and
sends two packets.
When two ACKs arrive, TCP increments CongestionWindow by 2 packets and sends
four packets and so on.
Instead of sending entire permissible packets at once (bursty traffic), packets are sent
in a phased manner, i.e., slow start.
Initially TCP has no idea about congestion, henceforth it increases
CongestionWindow rapidly until there is a timeout. On timeout:
CongestionThreshold = CongestionWindow/ 2
CongestionWindow = 1
Slow start is repeated until CongestionWindow reaches CongestionThreshold and
thereafter 1 packet per RTT.
The congestion window trace will look like
For example, packets 1 and 2 are received whereas packet 3 gets lost.
o Receiver sends a duplicate ACK for packet 2 when packet 4 arrives.
o Sender receives 3 duplicate ACKs after sending packet 6 retransmits packet 3.
o When packet 3 is received, receiver sends cumulative ACK up to packet 6.
The congestion window trace will look like
Average queue length is measured over a time interval that includes the
last busy + last idle cycle + current busy cycle.
It calculates the average queue length by dividing the curve area with time interval.
b. DECbit may lead to tail drop policy, whereas RED drops packet based on
drop probability in a random manner. Drop each arriving packet with some drop
probability whenever the queue length exceeds some drop level. This idea is
called early random drop.
Computation of average queue length using RED
RED has two queue length thresholds that trigger certain activity: MinThreshold and
MaxThreshold
When a packet arrives at a gateway it compares Avglen with these two values
according to the following rules.
Unit- 5
Application Layer and Case Studies
Electronic Mail-SMTP, POP3, IMAP, MIME– HTTP and HTTPS – Web
Services – DNS – SNMP- Wireshark Packet Capturing Tool - Cisco Packet
Tracer Tool - Open Source Network Tools - Manage Engine Tool.
Features of HTTP
o Connectionless protocol:
HTTP is a connectionless protocol. HTTP client initiates a request and waits
for a response from the server. When the server receives the request, the
server processes the request and sends back the response to the HTTP client
after which the client disconnects the connection. The connection between
client and server exist only during the current request and response time only.
o Media independent:
HTTP protocol is a media independent as data can be sent as long as both the
client and server know how to handle the data content. It is required for both
the client and server to specify the content type in MIME-type header.
o Stateless:
HTTP is a stateless protocol as both the client and server know each other
only during the current request. Due to this nature of the protocol, both the
client and server do not retain the information between various requests of
the web pages.
Request Message: The request message is sent by the client that consists of a
request line, headers, and sometimes a body.
Response Message: The response message is sent by the server to the client that
consists of a status line, headers, and sometimes a body.
HTTP REQUEST MESSAGE
Request Line
There are three fields in this request line - Method, URL and Version.
The Method field defines the request types.
The URL field defines the address and name of the corresponding web page.
The Version field gives the version of the protocol; the most current version of
HTTP is 1.1.
Some of the Method types are
Request Header
Each request header line sends additional information from the client to the
server.
Each header line has a header name, a colon, a space, and a header value.
The value field defines the values associated with each header name.
Headers defined for request message include
Body
The body can be present in a request message. It is optional.
Usually, it contains the comment to be sent or the file to be published on the
website when the method is PUT or POST.
Conditional Request
A client can add a condition in its request.
In this case, the server will send the requested web page if the condition is met or
inform the client otherwise.
One of the most common conditions imposed by the client is the time and date the
web page is modified.
The client can send the header line If-Modified-Since with the request to tell the
server that it needs the page only if it is modified after a certain point in time.
Status Line
The Status line contains three fields - HTTP version , Status code, Status
phrase
The first field defines the version of HTTP protocol, currently 1.1.
The status code field defines the status of the request. It classifies the HTTP
result. It consists of three digits.
1xx–Informational, 2xx– Success, 3xx–Redirection,
4xx–Client error, 5xx–Server error
The Status phrase field gives brief description about status code in text form.
Some of the Status codes are
Response Header
Each header provides additional information to the client.
Each header line has a header name, a colon, a space, and a header value.
Some of the response headers are:
Body
The body contains the document to be sent from the server to the client.
The body is present unless the response is an error message.
HTTP CONNECTIONS
HTTP Clients and Servers exchange multiple messages over the same TCP
connection.
If some of the objects are located on the same server, we have two choices: to
retrieve each object using a new TCP connection or to make a TCP connection and
retrieve them all.
The first method is referred to as a non-persistent connection, the second as a
persistent connection.
HTTP 1.0 uses non-persistent connections and HTTP 1.1 uses persistent
connections .
NON-PERSISTENT CONNECTIONS
HTTP COOKIES
An HTTP cookie (also called web cookie, Internet cookie, browser cookie, or
simply cookie) is a small piece of data sent from a website and stored on the user's
computer by the user's web browser while the user is browsing.
HTTP is stateless , Cookies are used to add State.
Cookies were designed to be a reliable mechanism for websites to remember
stateful information (such as items added in the shopping cart in an online store) or
to record the user's browsing activity (including clicking particular buttons, logging
in, or recording which pages were visited in the past).
They can also be used to remember arbitrary pieces of information that the user
previously entered into form fields such as names, addresses, passwords, and credit
card numbers.
Components of Cookie
A cookie consists of the following components:
1. Name
2. Value
3. Zero or more attributes (name/value pairs). Attributes store information such as
the cookie's expiration, domain, and flags
Creating and Storing Cookies
The creation and storing of cookies depend on the implementation; however, the principle
is the same.
1. When a server receives a request from a client, it stores information about
the client in a file or a string. The information may include the domain name
of the client, the contents of the cookie (information the server has gathered
about the client such as name, registration number, and so on), a timestamp,
and other information depending on the implementation.
2. The server includes the cookie in the response that it sends to the client.
3. When the client receives the response, the browser stores the cookie in the
cookie directory, which is sorted by the server domain name.
Using Cookies
When a client sends a request to a server, the browser looks in the cookie
directory to see if it can find a cookie sent by that server.
If found, the cookie is included in the request.
When the server receives the request, it knows that this is an old client, not a new
one.
The contents of the cookie are never read by the browser or disclosed to the
user. It is a cookie made by the server and eaten by the server.
Types of Cookies
1. Authentication cookies
These are the most common method used by web servers to know whether the user is logged
in or not, and which account they are logged in with. Without such a mechanism, the site
would not know whether to send a page containing sensitive information, or require the user
to authenticate themselves by logging in.
2. Tracking cookies
These are commonly used as ways to compile individuals browsing histories.
3. Session cookie
A session cookie exists only in temporary memory while the user navigates the website. Web
browsers normally delete session cookies when the user closes the browser.
4. Persistent cookie
Instead of expiring when the web browser is closed as session cookies do, a persistent
cookie expires at a specific date or after a specific length of time. This means that, for the
cookie's entire lifespan , its information will be transmitted to the server every time the user
visits the website that it belongs to, or every time the user views a resource belonging to that
website from another website.
HTTP CACHING
HTTP Caching enables the client to retrieve document faster and reduces load on
the server.
HTTP Caching is implemented at Proxy server, ISP router and Browser.
Server sets expiration date (Expires header) for each page, beyond which it is not
cached.
HTTP Cache document is returned to client only if it is an updated copy by
checking against If-Modified-Since header.
If cache document is out-of-date, then request is forwarded to the server and
response is cached along the way.
A web page will not be cached if no-cache directive is specified.
HTTP SECURITY
HTTP does not provide security.
However HTTP can be run over the Secure Socket Layer (SSL).
In this case, HTTP is referred to as HTTPS.
HTTPS provides confidentiality, client and server authentication, and data
integrity.
FTP OBJECTIVES
It provides the sharing of files.
It is used to encourage the use of remote computers.
It transfers the data more reliably and efficiently.
FTP MECHANISM
The above figure shows the basic model of the FTP.
The FTP client has three components:
o user interface, control process, and data transfer process.
The server has two components:
o server control process and server data transfer process.
FTP CONNECTIONS
There are two types of connections in FTP -
Control Connection and Data Connection.
The two connections in FTP have different lifetimes.
The control connection remains connected during the entire interactive FTP
session.
The data connection is opened and then closed for each file transfer activity.
When a user starts an FTP session, the control connection opens.
While the control connection is open, the data connection can be opened and
closed multiple times if several files are transferred.
FTP uses two well-known TCP ports:
o Port 21 is used for the control connection
o Port 20 is used for the data connection.
Control Connection:
o The control connection uses very simple rules for communication.
o Through control connection, we can transfer a line of command or line of
response at a time.
o The control connection is made between the control processes.
o The control connection remains connected during the entire interactive FTP
session.
Data Connection:
o The Data Connection uses very complex rules as data types may vary.
o The data connection is made between data transfer processes.
o The data connection opens when a command comes for transferring the
files and closes when the file is transferred.
FTP COMMUNICATION
FTP Communication is achieved through commands and responses.
FTP Commands are sent from the client to the server
FTP responses are sent from the server to the client.
FTP Commands are in the form of ASCII uppercase, which may or may not be
followed by an argument.
Some of the most common commands are
FTP SECURITY
FTP requires a password, the password is sent in plaintext which is
unencrypted. This means it can be intercepted and used by an attacker.
The data transfer connection also transfers data in plaintext, which is insecure.
To be secure, one can add a Secure Socket Layer between the FTP application
layer and the TCP layer.
In this case FTP is called SSL-FTP.
WORKING OF EMAIL
When Alice needs to send a message to Bob, she runs a UA program to prepare the
message and send it to her mail server.
The mail server at her site uses a queue (spool) to store messages waiting to be sent.
The message, however, needs to be sent through the Internet from Alice’s site to
Bob’s site using an MTA.
Here two message transfer agents are needed: one client and one server.
The server needs to run all the time because it does not know when a client will
ask for a connection.
The client can be triggered by the system when there is a message in the queue to
be sent.
The user agent at the Bob site allows Bob to read the received message.
Bob later uses an MAA client to retrieve the message from an MAA server
running on the second server.
USER AGENT (UA)
The first component of an electronic mail system is the user agent (UA).
It provides service to the user to make the process of sending and receiving a
message easier.
A user agent is a software package that composes, reads, replies to, and
forwards messages. It also handles local mailboxes on the user computers.
Command driven
o Command driven user agents belong to the early days of electronic mail.
o A command-driven user agent normally accepts a one character command from
the keyboard to perform its task.
o Some examples of command driven user agents are mail, pine, and elm.
GUI-based
o Modern user agents are GUI-based.
o They allow the user to interact with the software by using both the keyboard and
the mouse.
o They have graphical components such as icons, menu bars, and windows that
make the services easy to access.
o Some examples of GUI-based user agents are Eudora and Outlook.
Email was extended in 1993 to carry many different types of data: audio,
video, images, Word documents, and so on.
This extended version is known as MIME(Multipurpose Mail Extension).
SMTP also allows the use of Relays allowing other MTAs to relay the mail.
SMTP MAIL FLOW
SMTP Commands
Commands are sent from the client to the server. It consists of a keyword
followed by zero or more arguments. SMTP defines 14 commands.
SMTP Responses
Responses are sent from the server to the client.
A response is a three digit code that may be followed by additional textual
information.
SMTP OPERATIONS
Basic SMTP operation occurs in three phases:
1. Connection Setup
2. Mail Transfer
3. Connection Termination
Connection Setup
An SMTP sender will attempt to set up a TCP connection with a target host
when it has one or more mail messages to deliver to that host.
The sequence is quite simple:
1. The sender opens a TCP connection with the receiver.
2. Once the connection is established, the receiver identifies itself with
"Service Ready”.
3. The sender identifies itself with the HELO command.
4. The receiver accepts the sender's identification with "OK".
5. If the mail service on the destination is unavailable, the destination host
returns a "Service Not Available" reply in step 2, and the process is
terminated.
Mail Transfer
Once a connection has been established, the SMTP sender may send one or
more messages to the SMTP receiver.
There are three logical phases to the transfer of a message:
1. A MAIL command identifies the originator of the message.
2. One or more RCPT commands identify the recipients for this
message.
3. A DATA command transfers the message text.
Connection Termination
The SMTP sender closes the connection in two steps.
First, the sender sends a QUIT command and waits for a reply.
The second step is to initiate a TCP close operation for the TCP connection.
The receiver initiates its TCP close after sending its reply to the QUIT
command.
LIMITATIONS OF SMTP
SMTP cannot transmit executable files or other binary objects.
SMTP cannot transmit text data that includes national language characters, as these
are represented by 8-bit codes with values of 128 decimal or higher, and SMTP is
limited to 7-bit ASCII.
SMTP servers may reject mail message over a certain size.
SMTP gateways that translate between ASCII and the character code EBCDIC do
not use a consistent set of mappings, resulting in translation problems.
Some SMTP implementations do not adhere completely to the SMTP standards
defined.
Common problems include the following:
1. Deletion, addition, or recording of carriage return and linefeed.
2. Truncating or wrapping lines longer than 76 characters.
3. Removal of trailing white space (tab and space characters).
4. Padding of lines in a message to the same length.
5. Conversion of tab characters into multiple-space characters.
MIME HEADERS
Using headers, MIME describes the type of message content and the encoding
used.
Headers defined in MIME are:
MIME-Version- current version, i.e., 1.1
Content-Type - message type (text/html, image/jpeg, application/pdf)
Content-Transfer-Encoding - message encoding scheme (eg base64).
Content-Id - unique identifier for the message.
Content-Description - describes type of the message body.
MIME CONTENT TYPES
There are seven different major types of content and a total of 14 subtypes.
In general, a content type declares the general type of data, and the subtype
specifies a particular format for that type of data.
MIME also defines a multipart type that says how a message carrying more
than one data type is structured.
This is like a programming language that defines both base types (e.g., integers
and floats) and compound types (e.g., structures and arrays).
One possible multipart subtype is mixed, which says that the message contains a
set of independent data pieces in a specified order.
Each piece then has its own header line that describes the type of that piece.
The table below lists the MIME content types:
MTA is a mail daemon (sendmail) active on hosts having mailbox, used to send an
email.
Mail passes through a sequence of gateways before it reaches the recipient mail
server.
Each gateway stores and forwards the mail using Simple mail transfer protocol
(SMTP).
SMTP defines communication between MTAs over TCP on port 25.
In an SMTP session, sending MTA is client and receiver is server. In each
exchange:
Client posts a command (HELO, MAIL, RCPT, DATA, QUIT, VRFY, etc.)
Server responds with a code (250, 550, 354, 221, 251 etc) and an explanation.
Client is identified using HELO command and verified by the server
Client forwards message to server, if server is willing to accept.
Message is terminated by a line with only single period (.) in it.
Eventually client terminates the connection.
OPERATION OF IMAP
The mail transfer begins with the client authenticating the user and identifying the
mailbox they want to access.
Client Commands
LOGIN, AUTHENTICATE, SELECT, EXAMINE, CLOSE, and LOGOUT
Server Responses
OK, NO (no permission), BAD (incorrect command),
When user wishes to FETCH a message, server responds in MIME format.
Message attributes such as size are also exchanged.
Flags are used by client to report user actions.
SEEN, ANSWERED, DELETED, RECENT
IMAP4
The latest version is IMAP4. IMAP4 is more powerful and more complex.
IMAP4 provides the following extra functions:
A user can check the e-mail header prior to downloading.
A user can search the contents of the e-mail for a specific string of
characters prior to downloading.
A user can partially download e-mail. This is especially useful if bandwidth is
limited and the e-mail contains multimedia with high bandwidth requirements.
A user can create, delete, or rename mailboxes on the mail server.
A user can create a hierarchy of mailboxes in a folder for e-mail storage.
ADVANTAGES OF IMAP
With IMAP, the primary storage is on the server, not on the local machine.
Email being put away for storage can be foldered on local disk, or can be
foldered on the IMAP server.
The protocol allows full user of remote folders, including a remote folder
hierarchy and multiple inboxes.
It keeps track of explicit status of messages, and allows for user-defined status.
Supports new mail notification explicitly.
Extensible for non-email data, like netnews, document storage, etc.
Selective fetching of individual MIME body parts.
Server-based search to minimize data transfer.
Servers may have extensions that can be negotiated.
POP3 Commands
POP commands are generally abbreviated into codes of three or four letters The
following describes some of the POP commands:
1. UID - This command opens the connection
2. STAT - It is used to display number of messages currently in the mailbox
3. LIST - It is used to get the summary of messages
4. RETR -This command helps to select a mailbox to access the messages
5. DELE - It is used to delete a message
6. RSET - It is used to reset the session to its initial state
7. QUIT - It is used to log off the session
NAME SPACE
To be unambiguous, the names assigned to machines must be carefully selected
from a name space with complete control over the binding between the names and
IP address.
The names must be unique because the addresses are unique.
A name space that maps each address to a unique name can be organized in
two ways: flat (or) hierarchical.
Each node in the tree has a label, which is a string with a maximum of 63 characters.
The root label is a null string (empty string). DNS requires that children of a node
(nodes that branch from the same node) have different labels, which guarantees the
uniqueness of the domain names.
Domain Name
Each node in the tree has a label called as domain name.
A full domain name is a sequence of labels separated by dots (.)
The domain names are always read from the node up to the root.
The last label is the label of the root (null).
This means that a full domain name always ends in a null label, which
means the last character is a dot because the null string is nothing.
If a label is terminated by a null string, it is called a fully qualified domain
name (FQDN).
If a label is not terminated by a null string, it is called a partially qualified
domain name (PQDN).
Domain
A domain is a subtree of the domain name space.
The name of the domain is the domain name of the node at the top of the sub-
tree.
A domain may itself be divided into domains.
ROOT SERVER
A root sever is a server whose zone consists of the whole tree.
A root server usually does not store any information about domains but
delegates its authority to other servers, keeping references to those servers.
Currently there are more than 13 root servers, each covering the whole domain
name space.
The servers are distributed all around the world.
Generic Domains
The generic domains define registered hosts according to their generic
behavior.
Each node in the tree defines a domain, which is an index to the domain name
space database.
The first level in the generic domains section allows seven possible three
character levels.
These levels describe the organization types as listed in following table.
Country Domains
The country domains section follows the same format as the generic domains but
uses two characters for country abbreviations
E.g.; in for India, us for United States etc) in place of the three character
organizational abbreviation at the first level.
Second level labels can be organizational, or they can be more specific,
national designation.
India for example, uses state abbreviations as a subdivision of the country
domain us. (e.g., [Link].)
Inverse Domains
Mapping an address to a name is called Inverse domain.
The client can send an IP address to a server to be mapped to a domain name and it
is called PTR(Pointer) query.
To answer queries of this kind, DNS uses the inverse domain
DNS RESOLUTION
Mapping a name to an address or an address to a name is called name address
resolution.
DNS is designed as a client server application.
A host that needs to map an address to a name or a name to an address calls a DNS
client named a Resolver.
The Resolver accesses the closest DNS server with a mapping request.
If the server has the information, it satisfies the resolver; otherwise, it either refers
the resolver to other servers or asks other servers to provide the information.
After the resolver receives the mapping, it interprets the response to see if it is a real
resolution or an error and finally delivers the result to the process that requested it.
A resolution can be either recursive or iterative.
Recursive Resolution
The application program on the source host calls the DNS resolver (client) to find
the IP address of the destination host. The resolver, which does not know this
address, sends the query to the local DNS server of the source (Event 1)
The local server sends the query to a root DNS server (Event 2)
The Root server sends the query to the top-level-DNS server(Event 3)
The top-level DNS server knows only the IP address of the local DNS server at the
destination. So it forwards the query to the local server, which knows the IP address
of the destination host (Event 4)
The IP address of the destination host is now sent back to the top-level DNS
server(Event 5) then back to the root server (Event 6), then back to the source DNS
server, which may cache it for the future queries (Event 7), and finally back to the
source host (Event 8).
Iterative Resolution
In iterative resolution, each server that does not know the mapping, sends the IP
address of the next server back to the one that requested it.
The iterative resolution takes place between two local servers.
The original resolver gets the final answer from the destination local server.
The messages shown by Events 2, 4, and 6 contain the same query.
However, the message shown by Event 3 contains the IP address of the top-
level domain server.
The message shown by Event 5 contains the IP address of the destination local
DNS server
The message shown by Event 7 contains the IP address of the destination.
When the Source local DNS server receives the IP address of the destination, it
sends it to the resolver (Event 8).
DNS CACHING
Each time a server receives a query for a name that is not in its domain, it needs to
search its database for a server IP address.
DNS handles this with a mechanism called caching.
When a server asks for a mapping from another server and receives the response, it
stores this information in its cache memory before sending it to the client.
If the same or another client asks for the same mapping, it can check its cache
memory and resolve the problem.
However, to inform the client that the response is coming from the cache memory
and not from an authoritative source, the server marks the response as
unauthoritative.
Caching speeds up resolution. Reduction of this search time would increase
efficiency, but it can also be problematic.
If a server caches a mapping for a long time, it may send an outdated mapping to
the client.
To counter this, two techniques are used.
First, the authoritative server always adds information to the mapping called
time to live (TTL). It defines the time in seconds that the receiving server
can cache the information. After that time, the mapping is invalid and any
query must be sent again to the authoritative server.
Second, DNS requires that each server keep a TTL counter for each mapping it
caches. The cache memory must be searched periodically and those mappings with
an expired TTL must be purged.
DNS MESSAGES
DNS has two types of messages: query and response.
Both types have the same format.
The query message consists of a header and question section.
The response message consists of a header, question section, answer section,
authoritative section, and additional section .
Header
Both query and response messages have the same header format with
some fields set to zero for the query messages.
The header fields are as follows:
The identification field is used by the client to match the response with the
query.
The flag field defines whether the message is a query or response. It also includes
status of error.
The next four fields in the header define the number of each record type in
the message.
Question Section
The question section consists of one or more question records. It is
present in both query and response messages.
Answer Section
The answer section consists of one or more resource records. It is
present only in response messages.
Authoritative Section
The authoritative section gives information (domain name) about one or
more authoritative servers for the query.
Additional Information Section
The additional information section provides additional information that
may help the resolver.
DNS CONNECTIONS
DNS can use either UDP or TCP.
In both cases the well-known port used by the server is port 53.
UDP is used when the size of the response message is less than 512 bytes
because most UDP packages have a 512-byte packet size limit.
If the size of the response message is more than 512 bytes, a TCP connection is
used.
DNS REGISTRARS
New domains are added to DNS through a registrar. A fee is charged.
A registrar first verifies that the requested domain name is unique and then
enters it into the DNS database.
Today, there are many registrars; their names and addresses can be found at
[Link]
To register, the organization needs to give the name of its server and the IP
address of the server.
For example, a new commercial organization named wonderful with a server
named ws and IP address [Link], needs to give the following
information to one of the registrars:
Domain name: [Link] IP address: [Link]
DDNS (DYNAMIC DOMAIN NAME SYSTEM)
In DNS, when there is a change, such as adding a new host, removing a host, or
changing an IP address, the change must be made to the DNS master file.
The DNS master file must be updated dynamically.
The Dynamic Domain Name System (DDNS) is used for this purpose.
In DDNS, when a binding between a name and an address is determined, the
information is sent to a primary DNS server.
The primary server updates the zone.
The secondary servers are notified either actively or passively.
In active notification, the primary server sends a message to the secondary servers
about the change in the zone, whereas in passive notification, the secondary servers
periodically check for any changes.
In either case, after being notified about the change, the secondary server requests
information about the entire zone (called the zone transfer).
To provide security and prevent unauthorized changes in the DNS records, DDNS
can use an authentication mechanism.
DNS SECURITY
DNS is one of the most important systems in the Internet infrastructure; it
provides crucial services to Internet users.
Applications such as Web access or e-mail are heavily dependent on the proper
operation of DNS.
DNS can be attacked in several ways including:
Attack on Confidentiality - The attacker may read the response of a DNS server
to find the nature or names of sites the user mostly accesses. This type of
information can be used to find the user’s profile. To prevent this attack, DNS
messages need to be confidential.
Attack on authentication and integrity - The attacker may intercept the response
of a DNS server and change it or create a totally new bogus response to direct
the user to the site or domain the attacker wishes the user to access. This type of
attack can be prevented using message origin authentication and message
integrity.
Attack on denial-of-service - The attacker may flood the DNS server to
overwhelm it or eventually crash it. This type of attack can be prevented using
the provision against denial-of-service attack.
To protect DNS, IETF has devised a technology named DNS Security (DNSSEC)
that provides message origin authentication and message integrity using a security
service called digital signature.
DNSSEC, however, does not provide confidentiality for the DNS messages.
There is no specific protection against the denial-of-service attack in the
specification of DNSSEC. However, the caching system protects the upper- level
servers against this attack to some extent.
SNMP (SIMPLE NETWORK MANAGEMENT PROTOCOL)
The Simple Network Management Protocol (SNMP) is a framework for
managing devices in an internet using the TCP/IP protocol suite.
SNMP is an application layer protocol that monitors and manages routers,
distributed over a network.
It provides a set of operations for monitoring and managing the internet.
SNMP uses services of UDP on two well-known ports: 161 (Agent) and 162
(manager).
SNMP uses the concept of manager and agent.
SNMP MANAGER
A manager is a host that runs the SNMP client program
The manager has access to the values in the database kept by the agent.
A manager checks the agent by requesting the information that reflects the
behavior of the agent.
A manager also forces the agent to perform a certain function by resetting
values in the agent database.
For example, a router can store in appropriate variables the number of packets
received and forwarded.
The manager can fetch and compare the values of these two variables to see if the
router is congested or not.
SNMP AGENT
The agent is a router that runs the SNMP server program.
The agent is used to keep the information in a database while the manager is used
to access the values in the database.
For example, a router can store the appropriate variables such as a number of packets
received and forwarded while the manager can compare these variables to determine
whether the router is congested or not.
Agents can also contribute to the management process.
A server program on the agent checks the environment, if something goes wrong,
the agent sends a warning message to the manager.
SNMP MANAGEMENT COMPONENTS
Management of the internet is achieved through simple interaction between a
manager and agent.
Management is achieved through the use of two protocols:
o Structure of Management Information (SMI)
o Management Information Base (MIB).
Name
SMI requires that each managed object (such as a router, a variable in a router, a
value,etc.) have a unique name. To name objects globally.
SMI uses an object identifier, which is a hierarchical identifier based on a tree
structure.
The tree structure starts with an unnamed root. Each object can be defined
using a sequence of integers separated by dots.
The tree structure can also define an object using a sequence of textual names
separated by dots.
Type of data
The second attribute of an object is the type of data stored in it.
To define the data type, SMI uses Abstract Syntax Notation One (ASN.1)
definitions.
SMI has two broad categories of data types: simple and structured.
The simple data types are atomic data types. Some of them are taken directly
from ASN.1; some are added by SMI.
SMI defines two structured data types: sequence and sequence of.
Sequence - A sequence data type is a combination of simple data types, not
necessarily of the same type.
Sequence of - A sequence of data type is a combination of simple data types
all of the same type or a combination of sequence data types all of the same
type.
Encoding data
SMI uses another standard, Basic Encoding Rules (BER), to encode data to be
transmitted over the network.
BER specifies that each piece of data be encoded in triplet format (TLV): tag, length,
value
Management Information Base (MIB)
The Management Information Base (MIB) is the second component used in network
management.
Each agent has its own MIB, which is a collection of objects to be managed.
MIB classifies objects under groups.
MIB Variables
MIB variables are of two types namely simple and table.
Simple variables are accessed using group-id followed by variable-id and 0
Tables are ordered as column-row rules, i.e., column by column from top to
bottom. Only leaf elements are accessible in a table type.
SNMP MESSAGES/PDU
SNMP is request/reply protocol that supports various operations using PDUs.
SNMP defines eight types of protocol data units (or PDUs):
GetRequest, GetNext-Request, GetBulkRequest, SetRequest, Response,
Trap,InformRequest, and Report
GetRequest
The GetRequest PDU is sent from the manager (client) to the agent (server) to
retrieve the value of a variable or a set of variables.
GetNextRequest
The GetNextRequest PDU is sent from the manager to the agent to retrieve the
value of a variable.
GetBulkRequest
The GetBulkRequest PDU is sent from the manager to the agent to retrieve a large
amount of data. It can be used instead of multiple GetRequest and GetNextRequest
PDUs.
SetRequest
The SetRequest PDU is sent from the manager to the agent to set (store) a
value in a variable.
Response
The Response PDU is sent from an agent to a manager in response to GetRequest or
GetNextRequest. It contains the value(s) of the variable(s) requested by the manager.
Trap
The Trap PDU is sent from the agent to the manager to report an event. For example,
if the agent is rebooted, it informs the manager and reports the time of rebooting.
InformRequest
The InformRequest PDU is sent from one manager to another remote manager to get
the value of some variables from agents under the control of the remote manager. The
remote manager responds with a Response PDU.
Report
The Report PDU is designed to report some types of errors between managers.