Sunteți pe pagina 1din 150

Computer Networks &

Protocols

S. MEENATCHI SUNDARAM
Manipal Institute of Technology,
Manipal – 576 104
CHAPTER 1 – INTRODUCTION TO
COMPUTER NETWORKS
- Introduction
- Advantages & Disadvantages of Computer Networks
- Network Structures (Components)
- Network Hardware
- Network Topology
- Network Software
- Network Architecture
- Services
- Reference Models (ISO – OSI & TCP / IP)
- Examples

Computer Networks & Protocols by S.Meenatchisundaram 2


INTRODUCTION

Communication:
Convey a message / picture / speech
Data Communication:
Factors:
1. Transmission should be error free
2. Transmission time should be less
3. Cost of transmission is small
4. Message should be safe and secured
Mode of communication is digital due to:
i. High reliability
ii. Operating speed
iii. Miniaturization
iv. Precise data handling

Computer Networks & Protocols by S.Meenatchisundaram 3


COMPUTER NETWORKS

Inter connection of large computers, mini computers and


microcomputers. Also know as information networks.

Basic operations performed on information:


i. Store information
ii. Make decisions and manipulate data
iii. Move information.

Need for computer networks (Advantages):


Best utilization of available data, programs and computing systems.
1. Resource or load sharing:
- Operational advantage – sharing a unique technology, software and
large-scale computers.
- Managerial advantage: Managing the resource in efficient way.

Computer Networks & Protocols by S.Meenatchisundaram 4


COMPUTER NETWORKS Contd…

2. High Reliability:
- Provides back up facilities
- Alternative sources in case of hardware failure – useful for critical
application like air traffic control, Military, Banking, etc.
3. Saving of Money:
- Replacement of mainframe computers by small powerful pc’s:
Better performance ratio.
4. Communication medium:
- A powerful media for widely separated users ex: email.
5. Flexible working environment
- Access to information systems, for problem solving.
6. Scalability:
- Ability to increase system performance by adding more processors
with workload increasing.

Computer Networks & Protocols by S.Meenatchisundaram 5


COMPUTER NETWORKS Contd…

Disadvantages:
Network – global level leads to social, ethical and political problems like
i. Misuse of network for politics, religion, etc.,
ii. Moral issues
iii. Anonymous accusations
iv. Users rights to free speech
v. Employee rights v/s employer rights.

Computer Networks & Protocols by S.Meenatchisundaram 6


Network Structure (Components)
Boundary of
Communication
subnet

Network Host or
Station (Computers,
Communication Net
Terminals,
(Subnet)
Telephones
Communicating
Devices – End
stations)

Communication Net node


(OR) Interface Message
Processor (IMP)

Computer Networks & Protocols by S.Meenatchisundaram 7


Network Structure Contd…
C

C
C

C C

Orphan Terminals
(No local computers)

C C Nodes
Terminal, T
C C Computer / Computer
Terminals

Local Terminals

Remote Terminals

Computer Networks & Protocols by S.Meenatchisundaram 8


Network Structure Contd…
Network structure using DTE, DCE and DSE:
Digital data processing device
- Limited distance of data transmission
- Limited data transmission capability
DTE – Data Terminal Equipment – End User machine
DCE – Data Circuit Terminating Equipment (Ex. MODEM)
i. Interacts with DTE
ii. Transmits and receives bits one at a time over the communication
medium / channel.
iii. Provides an interface of DTE to communication network
DSE – Data Switching Equipment
- Route the user data through the network to the destination.
Connected in two ways (DCE & DTE)
i. Point to point configuration
ii. Multi drop configuration
Computer Networks & Protocols by S.Meenatchisundaram 9
Network Structure Contd…
DTE - A DCE - A DCE - B DTE - B

Digital Trmn. line Trmn. line Digital


data TR interface interface data TR
/ RR device device / RR

Transmission medium
(Communication
Signal & Control leads channel)
(Local Connections)

Point to Point configuration

DTE DCE DTE

DCE DCE DCE

DTE DTE DTE

Multidrop configuration

Analog & Digital Communication Systems by S.Meenatchisundaram 10


Network Structure Contd…

DCE

DTE

DCE

DCE DCE DSE


(NODE)

DCE DCE
DCE DCE

DTE

DCE DCE

DTE DTE

Analog & Digital Communication Systems by S.Meenatchisundaram 11


Network Structure Contd…

DTE and DCE Communication – 3 Ways:

1. Simplex: Transmission in one direction only (not commonly used for


data communication)
2. Half Duplex: Transmission in both direction but one at a time. (Used in
Keyboard, CRT, terminal based systems)
3. Full Duplex: Transmission in both directions simultaneously (Used in
systems – Continuous channel usage, high throughput, fast response
time.)

Computer Networks & Protocols by S.Meenatchisundaram 12


Network Hardware
The networks are generally classified based on two factors:
i. Techniques used for transferring the data.
ii. Architecture used (Scale)
Based on Transmission Technology:
1. Broadcast networks (Non switched)
2. Point to point networks (Switched)

Broad cast networks:


- Uses broadcasting principles.
- A single communication channel shared by all machines on the network.
- Each packet transmitted will be received by all.
- Machine will check the address field. If it gets matched with that
particular machine, the packet will further processed or else ignored.

Computer Networks & Protocols by S.Meenatchisundaram 13


Network Hardware Contd….
Example:
Packet radio N/W Satellite N/W Local Network (Bus & Ring)

Point – Point (switched) networks:


- Many connections between individual pairs
of machines
- Packets pass through intermediate machine
before reaching final destination.
- Packet may take different routes or paths
- Used by large networks.

Computer Networks & Protocols by S.Meenatchisundaram 14


Network Hardware Contd….
Classification based on scale
Inter Processor Processors located in same Example
distance

0.1 m Circuit board Data flow machine

1m System Multi computer

10 m Room

100 m Building LAN


1 km Campus

10km City MAN

100 km State, Country


WAN
1000 km Continent

10,000 km Planet (Global) Internet

Computer Networks & Protocols by S.Meenatchisundaram 15


Network Topology
- The way in which the stations are interconnected.

Features:
• Flexible to accommodate changes
• Cost of physical media and installation media should be minimum.
• Should not have any single point of complete failures.

Types of Topologies:
1. Bus / Tree topology
2. Star Topology
3. Ring Topology
4. Mesh Topology

Computer Networks & Protocols by S.Meenatchisundaram 16


Network Topology - Bus (Horizontal) Topology

• Connected to one by one by means of connectors


• All nodes receive data, but accepted by the concerned terminal
• Requires termination (Cable has to be terminated)
Advantages:
1. Easy to use and implement
2. Needs less physical connectivity devices
3. Bus can be extended using a repeater
4. Low cost
Disadvantage:
1. Heavy traffic slows down bus
2. Difficult in trouble shooting
3. Cable failure affects entire network.
Computer Networks & Protocols by S.Meenatchisundaram 17
Network Topology - Star Topology

• Devices get connected by point-to-point links thro a


central hub.
• Data travels from central hub and then to receiver.
Advantages:
1. Easy to modify with out disturbing rest of
network
2. Traffic flow is simple.
3. Easy to control
4. Troubleshooting is easier.
5. Failure of any node does not bring down the
whole star network.
Disadvantage:
1. If central hub fails, the entire network is down.
2. Each device requires its own cable segment
3. Installation can be moderately difficult.

Computer Networks & Protocols by S.Meenatchisundaram 18


Network Topology - Ring Topology

• Each computer is connected to next.


• Signal will travel in one direction only.
• Active network- retransmits everything.
• Termination not required.

Advantages:
1. Cable failures are easily found
2. Because every node is given equal access to the token,
no one mode can monopolize the network.

Disadvantage:
1. Adding or removing a node disrupts entire network
2. Difficult in trouble shooting
3. Failure of one node on the ring affect entire network.
4. Cost of cable is more in ring network.

Computer Networks & Protocols by S.Meenatchisundaram 19


Network Topology - Mesh Topology

• Link exists between each device in the network.


• May be true mesh or hybrid mesh.
Advantages:
1. Easy to install and fault tolerant for less number of devices.
2. Troubleshooting is easy.
3. Isolation of network failures is easy
Disadvantage:
1. For large number of devices – difficult to install.
2. Bandwidth is not completely utilized.
3. Cost is high because of maintaining redundant links.
4. Difficulty of reconfiguration.
5. High signal attenuation due to multipoint taps.
Computer Networks & Protocols by S.Meenatchisundaram 20
Network Topology - Other Topologies

Intersecting Rings
Irregular

Tree

Computer Networks & Protocols by S.Meenatchisundaram 21


Network Topology - LOCAL AREA NETWORK (LAN)
- Simple and basic approach.
- Privately owned – Building / Campus / Up to few Kms.
- Definition: LAN is a communication network that provides interconnection to a
wide variety of data communicating devices for high-speed data transmission with
in a limited geographical area through physical link and control software.
- Speed of transmission – 1 to 100 MBPS.
Classification of LAN depends on:
1. Network Topology May also be based on
2. Signaling method 1. Technology (Architecture & Design)
3. Network sharing and 2. Applications and
4. Contention technique 3. standards

LAN Access Techniques:


Satellite access (270msec delay per hop), Bus access (10 µsec), Ring access
The access can also be
Random (Stochastic) – ALOHA, slotted ALOHA, CSMA, CSMA / CD
Controlled (Deterministic) – Centralized (Star), Distributed (Ring, Bus)
Computer Networks & Protocols by S.Meenatchisundaram 22
Network Topology - LOCAL AREA NETWORK (LAN)

Components of LAN:
Physical channel – Coaxial cable, twisted pair wire, optical fiber, air.
Interface hardware – RS 232C / RS 485 interface, Laser emitting semiconductor
for optical fiber.
Network operating system:
- Implements data transferring
- Control LAN
- Helps in resource sharing
- Implemented using software and firm ware

Computer Networks & Protocols by S.Meenatchisundaram 23


Network Topology - METROPOLITAN AREA NETWORKS (MAN)

• Larger than LAN; covers city or group of offices

• Sponsored by IEEE, ANSI and Regional Bell operating - standards

• Topology – distributed queue dual bus (DQDB)

• TRANSFER RATE: 34 TO 150 Mbps

• Buses are unidirectional

• Topology may be open or closed.

• Two Head ends, one for each bus

• Based on fiber optic transmission technology

Computer Networks & Protocols by S.Meenatchisundaram 24


Network Topology - METROPOLITAN AREA NETWORKS (MAN)
Direction of flow on Bus A
Head
End

1 2 3 N

Head
Direction of flow on Bus B End

Two buses act as a broadcast medium leading to simple design of network. No


switching element is needed. Each head end generates a stream of 53 byte cells. These
cells fall off the bus when it reaches the end. Each cell carries 44 byte payload filed. It
also holds two protocol bits.
1. Busy: Set to indicated a cell’s occupancy.
2. Request: Set to make a request when a station wants.
The transmission activity is initiated by the head end. Traffic to the right of sender uses
upper bus and to the left uses lower bus. DQDB run upto 150 kms at speeds 44.736
Mbps.

Computer Networks & Protocols by S.Meenatchisundaram 25


Network Topology - WIDE AREA NETWORKS (WAN)

• Covers Larger Geographical Area (100 of Kms)


• Hosts are connected thro subnets
• Subnet – switching elements (Routers)

Transmission lines
• Packet is sent from one router to another thro intermediate routers.
• Follows store and forward technique. (Packet switching / point to point)
• Small packets – cells
• Interconnection of routers – topology
- Satellite system
- Ground radio system
- Transmission line

Computer Networks & Protocols by S.Meenatchisundaram 26


Network Software
• Exchange of data between the computers can take place directly or thro
communication network.
• Following factors has to be considered.
i. The source should indicate the direct data communication path or it has to
inform the communication network, the destination identity.
ii. Provide for standard interface between network functions.
iii. Symmetry has to be provided i.e. each layer should perform the same
function as its counter part in the other node of network.
• Network software should be highly structured.

In computer networks, the two important concepts are:


i. PROTOCOLS / STANDARDS
ii. Network Architecture.

Computer Networks & Protocols by S.Meenatchisundaram 27


Network Software - Protocols
PROTOCOLS / STANDARDS:
Is the set of rules governing the exchange of data between two entities with in a layer.
Entity: Active elements in each layer.
- Software
- Hardware
Peer: Entities on the same layers of different machines.
Key elements of a protocol:
Syntax: Includes data format and signals.
Semantics: Includes control information for coordination and error handling.
Timing: Includes sequencing and speed matching.
Protocols can be:
i. Direct / Indirect
ii. Multipoint / Broadcast type
iii. Monolithic / structured
iv. Symmetric / Asymmetric
v. Standard / non standard

Computer Networks & Protocols by S.Meenatchisundaram 28


Network Software - Protocols

Functions of protocols:
i. Signal generation ii. Segmentation and reassembly
iii. Encapsulation iv. Connection control
v. Flow control vi. Error control
vii. Synchronization viii. Sequencing
ix. Addressing and routing x. Multiplexing
xi. Transmission services xii. Security
xiii. Network management

Protocols ensures:
• Proper and polite communication between two parties
• Improves the efficiency
• Establish a set of rules to distinguish between data and control bits.

Protocol stack: List of protocols used by a system, one per layer.

Computer Networks & Protocols by S.Meenatchisundaram 29


Computer Network Architecture
• A set of layers and protocols
• Defines the communication tasks
• Name and function of layers differ from network to network.
Ex: A 5-layer network:
Layer – 5 - Protocol
Layer - 5 Layer - 5

Layer - 4 Layer – 4 - Protocol Layer - 4

Layer – 3 - Protocol
Layer - 3 Layer - 3

Layer – 2 - Protocol
Layer - 2 Layer - 2

Layer –1 - Protocol
Layer - 1 Layer - 1

Physical Medium

Computer Networks & Protocols by S.Meenatchisundaram 30


Computer Network Architecture
• Data transfer is from one layer to lower layer
• Data flow – Station A – L5 – L4 – L3 – L2 – L1 – PM – L1 – L2 – L3 – L4 – L5 –
Station B
• Interfaces: Junction between two layers.
Specified and established thro protocols
Defines the primitive operations and services offered to the upper layer.
Design considerations for the layers:
i. Each layer needs a connection mechanism and a terminating mechanism
ii. If a network has many computers, a means is needed so as to know with whom
a computer on the network wants to establish a connection.
iii. Rules for movement of data (simplex, half duplex, full duplex)
Two logical channels (normal data, Urgent data)
iv. Error control is needed – as communication circuits are not ideal.
v. Sequencing and synchronizing of messages
vi. Mechanisms for disassembling, transmitting and reassembling of messages.
vii. Multiplexing and demultiplexing of messages
viii. Routing and flow control between source and destination.
Computer Networks & Protocols by S.Meenatchisundaram 31
Network Services
Layer N - Provides services to layer N+1
- Uses the services of layer N-1
- Service Provider
Fast, Expensive Layer N

Slow, cheap ICI SDU

Layer N+1 - Service user


SAP SAP SAP
Layer N+1
IDU – Interface Data Unit
SDU – Service Data Unit ICI SDU ICI
ICI – Interface Control Information
SAP – Service Access Point
PDU – Protocol Data Unit
PCI SDU ICI
PCI – Protocol Control Information

PDU ICI

Computer Networks & Protocols by S.Meenatchisundaram 32


Network Services
Types of Services:
i. Connection oriented service
ii. Connection Less service

Connection Oriented Service (Virtual Circuit Service):


• Similar to a telephone system
• Service user has to Idle – No Connection
Establish a connection
Transmit data Connection Established
Terminate connection
Data Transfer

Connection Release

Idle – No Connection

Computer Networks & Protocols by S.Meenatchisundaram 33


Network Services
• Good care is taken for user data
• Flow control, error checking, error recovery is performed
• Used in WAN’s.

Sl.No Service Example


1 Reliable Message stream Sequence of pages
2 Reliable Byte Steam Remote login
3 Unreliable Connection Digitized voice and video (Delays due to
acknowledge makes if unreliable)

Computer Networks & Protocols by S.Meenatchisundaram 34


Network Services
Connection Less Service (Data Gram Service):
• Similar to postal system
• Each Packet is routed independently
• Connection establishment and release phase is absent
• No acknowledgement
• No flow control
• No error control
• QoS is obtained by the acknowledgement of receiver
• LANs normally use due to
Small area coverage
Private Owning Idle – No Connection

Services can be: Data Transfer


• Confirmed
• Unconfirmed
Idle – No Connection

Computer Networks & Protocols by S.Meenatchisundaram 35


Network Services
SERVICE PRIMITIVES:

Primitive Meaning
Request An entity wants the service to do some work
Indication An entity is to be informed about the events
Response An entity wants to responds to an even
Confirm The response to an earlier request has come back

User A Service Provider or Layer User B


Request

Indication

Response
Confirm

In a confirmed service, all the four primitives are available. In the unconfirmed service,
only the request and indication primitives are available.
Computer Networks & Protocols by S.Meenatchisundaram 36
Network Services
Relation between service and protocol:
Service:
• Set of operations that a layer provides to the layer above it.
• It does not say anything about how these operations are implemented.
Protocol:
• Set of rules governing the format and meaning of messages exchanged by
peer entities
• Entities use protocols to implement their services.
The primitives are invoked to and from the layer or service provider through identifiers
called SAPs.

Layer - N Layer - N

Computer Networks & Protocols by S.Meenatchisundaram 37


Network Reference Models
REFERENCE MODELS:
1. ISO – OSI Reference model
ISO – International Standards Organization.
OSI – Open System Interconnection.
2. TCP / IP Reference Model:
TCP – Transmission Control Protocol, IP – Internet Protocol.
OSI REFERENCE MODEL:
Principles:
1. Each layer has to perform well defined function.
2. Layers will be created considering its upper and lower layers only.
3. Any change with in the layer should not affect others.
4. Layer is created where there is need for handling data.
5. Functions of each layer and corresponding interface are chosen to define standardized
protocols.
6. Number of interactions at layer boundary is minimal.
7. The number of layers should be in such a way that the processing overhead should not
be treated as burden.
Computer Networks & Protocols by S.Meenatchisundaram 38
Network Reference Models
• Seven layer standard.
• Service provided:
1. Provide peer to peer logical services with layer physical implementation
2. Provides standard for communication between system
3. Defines point of interconnection for the exchange of information between
systems.
• The functions are partitioned into a vertical set of layers.
• Each layer provides service to the next higher layer and conceals the details of how the
offered services are implemented.

Note: OSI model is not a network architecture.


It is a reference model telling what each layer should do.
It does not specify the exact services and protocols for each layer.

Computer Networks & Protocols by S.Meenatchisundaram 39


Network Reference Models
Application Protocol
Application A APDU

P - Protocol
Presentation P PPDU

S - Protocol
Session S SPDU

Transport T - Protocol T TPDU

Subnet - Protocol

Network Network Network N Pac

Data Link Data Link Data Link Data Link (L) Frame

Physical Physical Physical PH Bits

Network Layer Host - Router Protocol


Data Link Layer Host - Router Protocol
Physical Layer Host - Router Protocol

Computer Networks & Protocols by S.Meenatchisundaram 40


Network Reference Models
AP ‘X’ AP Data AP ‘Y’

Application A - Protocol AH AP Data A

Presentation P - Protocol P
PH Data Unit

S - Protocol
Session SH Data Unit S

T - Protocol
Transport TH Data Unit T

N - Protocol

Network NH Data Unit N

Data Link F A C Data FCS F Data Link (L)

DH HDLC DT

Physical Bits PH

F – Flag, A – Address, C – Control, FCS – Frame Check Sequence


Computer Networks & Protocols by S.Meenatchisundaram 41
Network Reference Models
PHYSICAL LAYER (LAYER-1):
• Innermost layer concerned with Transmission of raw bits over the communication
channel.
• Related to set up a physical circuit to transmit the data.
Characteristics:
i. Physical: Pertains to actual physical connection of DTE and DCE.
ii. Electrical: Deals with voltage levels and timing of voltage changes.
iii. Functional: Specifies the functions to be performed like (data, control timing etc.)
iv. Procedural: Specifies the sequence of events for transmitting data.
Design Issues:
1. Correct transmission of 1’s and 0’s - Representation (v), Bit duration (µsec)
2. Transmission media - Twisted pair, co-axial cable, Fiber optics, commn. satellites.
3. Network connectors and pin details.
4. Transmission type – Duplex / Simplex, Analog / Digital, FDM / TDM, Switching.
5. Initial and Terminating conditions.

Standards: RS232C, RS449/422/423, etc.


Computer Networks & Protocols by S.Meenatchisundaram 42
Network Reference Models
DATA-LINK LAYER (LAYER-2):
• Makes the physical link reliable.
• Sends frames with necessary synchronization, error control and flow control.
• Provides means for activating, maintaining and deactivating the link
• Header and Trailer are attached to data block.
Issues:
1. Transmission block starting and ending
2. Transmission error detection
3. Error control to get on error free link
4. Addressing of message to one of many machines
5. Avoiding overlap in physical circuit when several machines share the circuit.
Design involves:
1. Service to Network layer, 2. Framing and link management
3. Error control and flow control
4. Error detection and correction
5. Data link protocols and their performance
Devices related:- Bridges, Intelligent hubs etc.
Computer Networks & Protocols by S.Meenatchisundaram 43
Network Reference Models

NETWORK LAYER (LAYER-3):


• Concerned with controlling the operation of the subnet.
• Provides services to the transport layer
• Determines routing of pockets from source to destination.
• Provides congestion control when the traffic is high.
• Provides accounting and billing of each customer.
• Responsible for establishing, maintaining and terminating connections.
• Uses switching network for selection of route.
• Devices used – Routers, gateways etc.

TRANSPORT LAYER (LAYER-4):


• Provides services to the session layer
• Provides efficient, reliable and cost effective service to its users.
• Service may be connection less or connection oriented.
• Takes complete responsibility of data movements.
• Error free delivering with no losses or duplications.

Computer Networks & Protocols by S.Meenatchisundaram 44


Network Reference Models

• Act as the heart of the whole protocol hierarchy acting as a liaison between user and
communication facility.
• Flow control of transactions.
• Sends an acknowledgement to the originator for packets that are received.
• Accepts data from the session layer and passes the data, split into smaller blocks to the
network layer.

SESSION LAYER (LAYER-5):


• Shared connection – session between user on different machines.
• Provides services to the presentation layer.
• Manage dialogue control between applications.
• Does token management for some protocols.
• Does checking and recovery when failure occurs between check points inserted.
• Provides synchronization.

Computer Networks & Protocols by S.Meenatchisundaram 45


Network Reference Models
PRESENTATION LAYER (LAYER – 6)
• Formats the data to adapt to the needs of application layer.
• Concerned with syntax and semantics of the data exchanged between application
entities.
• Conversion of character streams so that devices with different character sets can
communicate.
• Network security and privacy (Encryption and Decryption)

APPLICATION LAYER (LAYER – 7)


• A means for application process to access OSI environment
• Application like – Data base access, email, file transfer.
• User program to do the actual work
• Allows application of one computer to communicate with application on other
computers.
• Application layer receives data in original size.

Computer Networks & Protocols by S.Meenatchisundaram 46


Network Reference Models
APPLICATION LAYER
Provides access to OSI environment for users and also provides distributed information services
PRESENTATION LAYER
Provides independence to application processes from differences in data representation (syntax)
SESSION LAYER
Provides the control structure for communication between application; establishes manages and
terminates sessions between cooperating applications.
TRANSPORT LAYER
Provides reliable, transparent transfer of data between end points; provides end to end recovery and
flow control
NETWORK LAYER
Provides upper layers with independence from the data transmission and switching technologies used to
connect systems; responsible for establishing, maintaining and terminating connections.
DATA LINK LAYER
Provides for the reliable transfer of information across the physical link; sends frames with necessary
synchronization, error control and flow control
PHYSICAL LAYER
Concerned with transmission of unstructured bit steam over physical media; deals with the mechanical,
electrical, functional and procedural characteristics to access the physical medium.

Computer Networks & Protocols by S.Meenatchisundaram 47


Network Reference Models
TCP / IP REFERENCE MODEL:
It is a packet switching network.
7. APPLICATION
4. APPLICATION LAYER
6. PRESENTATION

5. SESSION 3. TRANSPORT LAYER

4. TRANSPORT 2. NETWORK LAYER


3. NETWORK (INTERNET LAYER)

2. DATA LINK 1. HOST TO NETWORK


1. PHYSICAL

Application Layer:
It contains all the higher level protocols such as TELNET, FTP, SMTP (Simple mail transfer
protocol), remote – login. These interact with TCP in the transport layer.
Other protocols like DNS (Domain Name Service), SNMP (Simple Network Management
Protocol), HTTP (Hyper Text Transfer Protocol) interacts with UDP (User Datagram
Protocol) of the transport layer.
The interaction between the user and the computer network is initiated by ‘commands’ and
these commands invoke appropriate protocols in the application layer.

Computer Networks & Protocols by S.Meenatchisundaram 48


Network Reference Models
Transport Layer:
Two end to end protocols are defined
(a) TCP (reliable)
(b) UDP (unreliable)

TCP: It is a reliable connection oriented protocol that allows transmission of data stream
with any error. The transmitting TCP will fragment the data into ‘messages’ and pass it to
network layer. The receiving TCP will reassembles the messages. Retransmission request is
sent to the sending TCP if the received message is erroneous. TCP also handles flow
control.

UDP: It is unreliable connectionless protocol. It is useful for applications where the TCP
sequencing, flow control and accurate delivery is not needed.

Computer Networks & Protocols by S.Meenatchisundaram 49


Network Reference Models
Network Layer (Internet Layer):
It holds the whole architecture together based on packet-switched connectionless network.
(a) The IP layer translates the source and destination address obtained from the TCP
segment into a form, which is universally recognized by all the networks. For this an IP
header will be attached.
(b) The second function of IP is to fragment the TCP segment into smaller pieces for proper
routing (these will have the same IP header, but different sequence number). Rearranging is
needed as they arrive at the destination in a different sequence.
(c) The third function is to provide routing information in the IP header (to avoid congestion
and longer routes)

Host - Network or Link Layer:


It provides a header and a trailer. The IP datagram along with the header and the trailer
appended in this layer is called a frame.
The TCP/IP model does not say about what happens in this layer. The protocol varies from
host to host and network to network.

Computer Networks & Protocols by S.Meenatchisundaram 50


Network Reference Models

User Data

AH User Data A

TCPH Application Data TCP

TCP Segment

IPH TCPH Application Data


IP
IP Datagram

LH IPH TCPH Application Data LT PHY - MEDIUM

Link Frame

Trailer is a 32 bit CRC used for error detection.

Computer Networks & Protocols by S.Meenatchisundaram 51


Network Reference Models - Comparison
Similarities:
(a) Stack of independent protocols.
(b) Functions of the layers.
(c) End to end and application / user oriented services.
Differences:
ISO – OSI TCP / IP
1. Clear distinction between the three concepts Not very clear distinction
(services, interfaces and protocols) exist. (Services Ex: The real service offered by Internet layer is
define the layer operation, protocol is a set of sending and receiving IP packets.
rules to implement the service, and interface tells
the processes above it how to access it.
2. Protocols are more hidden Less hidden.
3. The model came first and then the protocol. The protocol came first and then the model.
4. The protocols were quite general. Hence the The protocols fit perfectly with the model.
layers were having less specific functionality. Good only for TCP / IP networks.
(Designers had less experience)
5. 7 layers 4 layers

Computer Networks & Protocols by S.Meenatchisundaram 52


Example Problems
ISO – OSI TCP / IP
6 Supports both connection oriented and connectionless Supports connectionless communication
communication
. in the network layer. in network layer.
7 Only connection oriented communication in transport Supports both connection oriented and
layer.
. connectionless communication in the
transport layer (TCP, UDP)

Example 1:
Find the propagation delay for a signal traversing the following networks at a speed of 2.3 x
108m/sec in cable;
i) A circuit board: 10 cm
ii) A campus: 1km
iii) Up and down to a geostationary satellite: 2 x 36,000 kms
Solution:
(i) Propagation delay, tp = 0.1m/ 2.3 x 108m/sec = 0.435 nsec
(ii) Propagation delay, tp = 1000m/ 2.3 x 108m/sec = 4.35 µsec
(iii) Propagation delay, tp = 2 x36000 x 1000m/ 2.3 x 108m/sec = 313 msec

Computer Networks & Protocols by S.Meenatchisundaram 53


Example Problems
Example 2:
In the example 1, how many bits are in transit during the propagation delay if bits are
entering the networks of example 1 at (i) 10 kbps (ii) 10 Mbps (iii) 10 Gbps.
Solution:
For the circuit board network:
(i) Number of bits in transit, b = (0.435 nsec) (10 kbps) = 4.35 µbits
(ii) b = (0.435 nsee) (10 Mbps) = 4.35 mbits
(iii) b = (0.435 osee) (10 Gbps) = 4.35 bits
For the campus network: .
(i) b = (4.35 µsec) (10 kbps) = 43.5 mbits
(ii) b =(4.35 µsec) (10 Mbps) = 43.5 bits
(iii) b =(4.35 µsec) (10 Gbps) = 43.5 kbits
For the geostationary satellite network:
(i)b = (313 msec) (10 kbps) = 3.13 kbits
(ii) b = (313 msec) (10 Mbps) = 3.13 Mbits
(iii) b = (313 msee) (10 Gbps)= 3.13 Gbits

Computer Networks & Protocols by S.Meenatchisundaram 54


Example Problems
Example 3: Consider three packet switching networks each with N nodes. The first network
has a star topology with a central switch, the second is a unidirectional ring and the third is
fully interconnected with a wire from every node to every other node. What are the best and
worst case transmission paths in hops?
Solution:
Star Network:
Each node is connected to the other through the central switch. A minimum of two hops is
required for any two nodes to be interconnected. The same is true for the worst case.
Best case transmission path in hops = 2, and
worst case communication path in hops = 2
Ring Network:
The best case transmission path in hops = 1.
The worst case needs (N - 1) number of hops for an unidirectional ring and N/2 number of
hops for a bi-directional ring.
Mesh Network:
As each node has a direct link to each other node, the number of hops for best and worst
cases = 1.

Computer Networks & Protocols by S.Meenatchisundaram 55


Example Problems

Example 4: Assume six devices are arranged in a mesh topology. How many cables are
needed? How many ports are needed for each device?
Solution:
Number of cables needed = N(N-1)/2 = 6(6-1)/2=15
Number of ports needed for each device = (N - 1) = (6 - 1) = 5

Example 5:
For N devices in a network, what is the number of cable links required for a mesh, ring and
star topology?
Solution:
Number of cable links needed for
Mesh: N(N -1) /2
Ring: N
Star: N

Computer Networks & Protocols by S.Meenatchisundaram 56


Example Problems

Example 6:
Suppose two new devices are added to an existing live devices network. If the network has
mesh topology, how many new cable links are needed? How many new links are needed when
the network arrangement has a ring topology?

Solution:
Mesh Topology:
Cable links needed for 5 devices = 5(5 -1)/2 = 10
Cable links needed for (2 + 5) devices = 7(7 -1)/2 = 21
New cable links needed = (21 - 10)= 11

Ring topology:
Cable links needs for 5 devices = 5
Cable links needed for 7 devices = 7
New links needed = (7 - 5) = 2

Computer Networks & Protocols by S.Meenatchisundaram 57


CHAPTER 2 – PHYSICAL LAYER
- Introduction
- Analog and Digital Transmission
- Transmission Media (Medium)
- Multiplexing
- FDM
- TDM (STDM, ATDM)
- WDM
- MODEM
- Switching Techniques
- Circuit Switching
- Message Switching
- Packet Switching
- Comparison between switching methods
- Examples
Computer Networks & Protocols by S.Meenatchisundaram 58
Introduction
It is the innermost layer concerned with the transmission of raw bits over a communication
channel. It's design issues are 1s and 0sas representation, bit duration, transmission media, and
transmission type. The successful transmission of data mostly depends on
(i) quality of signal being transmitted and
(ii) characteristics of the transmission medium

Analog and Digital Transmission:


Digital transmission (communication) is superior to analog transmission with several
advantages:
i) Very low error rate: In analog circuits the error is cumulative over long distance
communication and amplifiers give rise to considerable distortion. Digital regenerators do not
suffer cumulative error.
ii) In digital transmission, voice, data, music, image can all be multiplexed.
iii) Higher data rates possible.
iv) There is continuous drop in cost, size of digital circuitry.
v) Security and privacy is more.

Computer Networks & Protocols by S.Meenatchisundaram 59


Transmission Media (Medium)
The purpose / requirement of physical layer is to transport bit stream from one machine to
another. For this, a physical media is needed (for actual transmission).
The transmission medium may be
(i) Guided (over a physical path)
(ii) Unguided (over air, vacuum, seawater).

Transmission may be point-to-point or multipoint. The medium may be simplex, half duplex
or full duplex.

The medium used depends on


(i) Cost (ii) Analog/Digital (iii) Wideband / Narrowband (iv) Switched / Non-switched

Various media used are,


(i) Twisted Pair (ii) Co-axial Cable
(iii) Optical Fiber (iv) Line of sight wave
(v) Point-to-Point microwave (vi) Cellular / Packet radio

Computer Networks & Protocols by S.Meenatchisundaram 60


Transmission Media (Medium)
i) Twisted Pair:
Shown in fig., it is the oldest, most common transmission medium with data rates up to 1
Mbps, used in telephone system.
ii) Co-axial Cable:
There are two types.
a) Baseband (50Ω) and
b) Broadband (75Ω)
a) Baseband Cable: For one-kilometer cables data rates upto 10 Mbps is possible. It can be
higher for shorter cables. These are widely used within telephone systems.
For broadband cables, data can exceed 100Mbps. Cable TV 75Ω cable can have bandwidth up
to 300 MHz (even upto 450MHz)

Computer Networks & Protocols by S.Meenatchisundaram 61


Transmission Media (Medium)
iii) Optical Fiber:
Optical fiber are successfully used for data transmission rates upto 1—Gbps over 100kms.
Typical use: several 1000s Mbps for 30Km link.
Advantages of fiber optics are:
a) Smaller diameter, lighter weight
.•• b) Lower cost
c) Immune to Electro magnetic interference.
d) Low attenuation (0.5db/Km)
e) Safe and secure
f) Longer life (20 to 30 years)
g) High tolerance to temperature
h) Extremely large bandwidth (> 1013 Hz) (achievable bandwidth exceeds 50,000
Gbps (50 Tbps)).

The main problem is in the conversion between electrical and optical signals (with practical
signaling limits).

Computer Networks & Protocols by S.Meenatchisundaram 62


Transmission Media (Medium)

Attenuation (dB)
.••

Frequency------>
iv) Line of sight and point to point microwave communication:
No physical medium is used. Parabolic antennas are used (Refer to Fig.) to focus the waves
into a small beam. This is done for waves above 100Mhz as they travel in straight lines.
Repeaters are used at the, intervals of 60 to 80Kms (depending on the height of towers).
Microwave communication is in Ghz range.

Computer Networks & Protocols by S.Meenatchisundaram 63


Transmission Media (Medium)
' v) Satellite:
Satellites are repeaters in space and use microwave frequencies. The propagation delay range
from 100 to 300msec depending on the height of the satellite. The medium used should be
reliable, less expensive, simple, high speed, noise free, easy to install and maintain.

.••
Satellite

Maximum data rate of a channel:


=2 B log2L bits/sec (Nyquist Theorem)
=Blog2(1+S/N)
Where, B – Bandwidth of a noiseless channel
L – Number of discrete levels of the signal
S/N – Signal to Noise ratio
Computer Networks & Protocols by S.Meenatchisundaram 64
Multiplexing
' Transmission facilities are normally expensive. Most of the time two communicating stations
will not utilize the full capacity of a data link. For efficiency and economy, it is more
appropriate to share the capacity. This sharing is termed as multiplexing.
Multiplexing involves grouping of several channels to transmit them simultaneously on the
same physical medium without mixing. At the receiving end, de-multiplexing is done to
.••
separate the channels.
In the telephone system, each channel provides a bandwidth of 300-3400 Hz for speech
signals. Transmission facilities can carry large number of voice and data transmissions
simultaneously using multiplexing.

There are four types of multiplexing techniques.


a) FDM: Widely used for Radio and TV broadcasting.
b) TDM (STDM (Synchronous TDM: Commonly used for multiplexing digitized
voice streams.
c) Statistical TDM (ATDM (Asynchronous TDM: Improved and efficient as compared to
STDM.
d) WDM: A variation of FDM used for fiber optic channels.

Computer Networks & Protocols by S.Meenatchisundaram 65


Multiplexing
a) Frequency division multiplexing (FDM) :
'
(i) Translation of the speech signal (300-3400Hz) band to a higher frequency band and
(ii) Combining all the channels to get frequency division multiplexed signal. 4000Hz is
allocated to each channel (3100Hz for the user signal and two guard bands of 450Hz each).
Three-voice signals multip1exed in frequency is shown in fig.

.••

There will be some overlap between adjacent channels, as filters do not have sharp edges. A
simplified block diagram of channel translating equipment is shown in fig. for the formation
of a standard 12-channel group used for FDM. In this standard group twelve 4000Hz voice
channels are multiplexed into the 60 to 108Khz band. This unit is called a group-B.

Computer Networks & Protocols by S.Meenatchisundaram 66


Multiplexing
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 67


Multiplexing
FDM Hierarchy:
' Consultative Committee for International Telephony and Telegraphy (CCITT) has
recommended a standard frequency translation plan for worldwide usage. 12 channels are
multiplexed into a unit called group and then groups are multiplexed to form super groups
and so on as shown in table.

.••

Computer Networks & Protocols by S.Meenatchisundaram 68


Multiplexing
Time Division Multiplexing (TDM):
' The basis of TDM is sampling theorem and TDM is an extension of pulse Modulation. TDM
is a method of separating pulses belonging to different transmissions in the time domain.
TOM is useful only for digital data and analog to digital conversion is needed. This digitizing is
done by a CODEC.
The codec generates 8000 samples per second (125µsec / sample) (refer fig.) to satisfy the
.•• Nyquist rate for the 4Khz telephone channel bandwidth. PCM is used for converting analog
samples to digital form (in 2 stages - quantization and coding). PCM is widely used in the
modern telephone system and all time intervals are multiples of 125 µsec.
Samples are separated by 125 µsec at the standard sampling rate of speech signal. In this
interval samples of other speech signals are sent (the sampling clocks are synchronized and
staggered in time) for TDM.

Computer Networks & Protocols by S.Meenatchisundaram 69


Multiplexing
'

.••

T1 Carrier system is widely used in USA and Japan. It consists of 24 voice channels (4Khz)
multiplexed and is based on PCM. 24 voice signals are sampled sequentially and the resulting
analog stream is fed into a codec. Each sample is coded with a 7-bit binary code and the eighth
bit is for control. PCM signal from each channel is an 8-bit signal. For 24 channels 24 x 8 =
192 bits will be on the line. With one extra bit for framing (for synchronization between
transmitting and receiving terminals), there will be 193 bits in a frame of 125 µ sec.

Computer Networks & Protocols by S.Meenatchisundaram 70


Multiplexing
'

.••

Number of bits/see on line = 193/ 125µsec = 193 x 8000 = 1.544Mbps.


i.e. the PCM signal of the T1 carrier is a 1.544Mbps signal. It is also known as digital signal 1
(DS1).
CCITT has recommended standards for PCM channels. The basic PCM signal multiplexes 30
speech channels with 8-bit coding for the samples. It consists of 32 time slots frame with each
slot containing 8-bits code as shown in fig. are used for information and two for signaling.
The 30 channels PCM frame format is shown below.
Computer Networks & Protocols by S.Meenatchisundaram 71
Multiplexing
'

.••

Time slot 0 – For flags, Alarm Time slot 16 – For Signaling.


1 to 15 and 17 to 31 – For channels 1 to 30.
Time slot 16 contains signaling information derived from the dialed digit.
Number of bits/sec in frame = 256/125µsec=32 x 8 x 8000
= 2.048Mbps.

Computer Networks & Protocols by S.Meenatchisundaram 72


Multiplexing
Synchronous TDM (STDM):
' (Normally known as TDM): Synchronous TDM is possible when the achievable data rate of
the transmission medium exceeds ,the data rate of digital signals to be transmitted. Multiple
digital signals are carried over a single transmission path by interleaving portions of each
signal in time. The interleaving may be at the bit level or in the blocks of bytes or larger
quantities. A synchronous TDM system is shown in fig.
.••

'.
~
'
)

The incoming data from each source are buffered. Normally each buffer is one bit or one
character in length. The buffers are scanned sequentially to get the composite digital data
stream mc(t). The data rate of mc(t) must be at least equal to the sum of the data rates of
m1(t), m2(t),…. mN(t). The scanning is to be quite rapid so that each buffer is emptied before
more data arrives. The data are organized into frames as shown in fig.
Computer Networks & Protocols by S.Meenatchisundaram 73
Multiplexing
'

.••

Each frame consists of a cycle of time slots. In each frame one or more slots are dedicated to
each data source. The slot length is equal to transmitter buffer length (a bit or a character).
Bit interleaving technique is used with synchronous sources and character interleaving with
asynchronous sources. Synchronous TDM is called synchronous, as the time slots are pre
assigned to sources and fixed. The time slots are transmitted whether or not the source has
data to send. This is a big disadvantage of STDM as the time slot is wasted. If there are no
data, dummy characters are used.

Computer Networks & Protocols by S.Meenatchisundaram 74


Multiplexing
Statistical or Asynchronous TDM (ATDM):
'
ATDM makes use of the line capacity much more efficiently than synchronous TDM. It is also
known as intelligent TDM or concentrator. The statistical multiplexer has a number of I/O
lines on one side and a higher speed multiplexed line on the other side. The data rate on the
multiplexed line will be less than the sum of I/P data rates. Here each time slot carries an
address (overhead) as well as data.
.••
In some TDM, when the actual traffic is far below the potential traffic, most of the time slots
on the O/P line are wasted. Normally an O/P line with less capacity than the sum of input
lines is considered. This arrangement is known as concentration. If there are N I/P lines, N
time slots are available on synchronous TDM frame and < N time slots for Asynchronous
TDM. In ATDM, dummy characters are not transmitted.
Consider the data produced by the 4 terminals in two time intervals (t1-t0) and (t2-t1). I n each
interval data are collected from all the sources and sent (refer fig).
In STDM, in the first interval, C and D produce no data and the two time slot are transmitted
empty, which is a waste.
In ATDM, (statistical TDM), during the first interval only slot A and B are sent as the
positional significance is lost, address information is needed to assure proper delivery and
reception, in ATDM, each slot carries address and data. Hence a lower capacity and data rate
multiplier can be used with ATDM as compared to STDM ..
Computer Networks & Protocols by S.Meenatchisundaram 75
Multiplexing
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 76


Multiplexing
' One difficulty with ATDM (concentrator) is that some data may be lost if all the terminals
(sources) start giving data at its maximum rate. Normally concentrators are provided with extra
buffers for short data surges or peak periods. A trade off between the size of the buffer used
and the data rate of the line is normally done.
K = Ratio of multiplexed line capacity to total maximum input = M / NR
Where
.••

M =Effective capacity of multiplexed. line. N = Number of input sources.


R = Data rate of each source, bps.
K = 1 for STDM and K< 1 for ATDM

Computer Networks & Protocols by S.Meenatchisundaram 77


Multiplexing
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 78


Multiplexing
' Wavelength Division Multiplexing (WDM):
WDM is a variation of FDM in fiber optic channels. Optical channel has vast capacity
potential available to be tapped for multi-user networks / applications. As the bandwidth of a
single fiber band exceeds 25,000Ghz, there is vast potential for multiplexing many channels
(the incoming channels use different frequencies). The basic principle of WDM is illustrated in
fig.
.••

Computer Networks & Protocols by S.Meenatchisundaram 79


Multiplexing
'

.••

LED (source) has a broad spectral width. The LED is intensity modulated at different
wavelengths. Single mode (SM) fiber transmits the signal along with other signals at different
wavelengths. Multiplexing is done to assemble/de-assemble the signals. WDM process can be
performed by the use of
i) Wavelength selective elements.
ii) Diffraction grating (Prisms).
iii) Optical broadband coupling arrays.
iv) Directional Couplers.
v) Spectral filters
Computer Networks & Protocols by S.Meenatchisundaram 80
MODEM
' A modulator-demodulator converts digital data to analog signals and vice versa. It converts a
series of binary voltage pulses into an analog signal by encoding the digital data on to a carrier
frequency. At the other end, the modem demodulates to recover the original data. Most
common modems represent digital data in the voice spectrum and they are propagated over
ordinary telephone lines.

.••

Modems differ in data rate, modulation methods and bandwidth. FSK is most common form
of digital communication in use with telephone transmission systems. Other schemes used are
PSK, 4/8 Phase PSK, QAM, VSB AM.

Modems can be
a) Simplex / Half Duplex / Full Duplex
b) Synchronous! Asynchronous.
c) Low speed (up to 600bps) / Medium speed (600 - 2400bps) / High speed (2400 to
10800 bps).

Computer Networks & Protocols by S.Meenatchisundaram 81


Switching Techniques
Switched Communication Networks:
' It consists of an interconnected collection of IMPs (or Nodes) in which data are transmitted
from source to destination routed through the network of IMPs. The IMPs are connected by
transmission paths as shown in fig.

.••

Data entering the network from a host (or station) are routed to the destination by being
switched from IMP to IMP. There are three ways in which data are switched from one link to
another .
a) Circuit Switching.
b) Message Switching
c) Packet switching.
Computer Networks & Protocols by S.Meenatchisundaram 82
Switching Techniques
Computer to computer traffic differs from human to human traffic (telephone system). Human to
' human traffic needs continuous use of low bandwidth channel where as computer-to-computer
traffic needs intermittent use of a high bandwidth channel. Hence. a different type of
communication network is needed. This is achieved by switching techniques.

Circuit Switching:
.••
The most common example of circuit switching is a telephone network. Here a physical copper path
is set up and maintained for the duration of message transmitted. i.e. there will be a dedicated
communication path between two hosts and the path is a connected sequence of links between IMPs
or nodes. A circuit switch is made of
i) Traditional electro-mechanical contacts (old telephone exchanges) which takes seconds to set
up the switched path or
ii) Solid-state electronic contacts (no moving parts) which, takes millisecond or less Fast-Connect
switching.
In circuit switching the path between two users will be setup by the Switches, the user data sent, and
milliseconds later, a new path will be connected for different users. Communication via circuit
switching involves three phases
i) Circuit establishment ii) Data transfer iii) Circuit disconnect
Circuit switching can be done manually or automatically. Simple circuit switching model for a
telephone system is shown in fig.
Computer Networks & Protocols by S.Meenatchisundaram 83
Switching Techniques

Multiplexing can be done when the copper path is a wide band link (microwave link, etc). It
takes several seconds to establish a path for communication depending on the type of call
(long-distance or local).
Consider the computer switching net shown in fig. Let A needs to connection to E. Hosts to
IMPs are all dedicated lines.

Computer Networks & Protocols by S.Meenatchisundaram 84


Switching Techniques
Circuit establishment: A sends a request to IMP 6 to get a connection to E. Based on routing
information and cost, next leg is selected 6 to 5 (or 6 to 7) and then 5 to 4 is a dedicated line.
After the connection to E, test is made to determine if E is busy or not.
Data transfer: is done in the path A-6, internal switching through 6, 6-5 link, internal switching
through 5, 5-4, and internal switching through 4, 4-E link.
Circuit disconnect: after the data transfer, the connection is terminated by one of the hosts A or
E. Now signals must be propagated to 6,5,4 to de-allocate the dedicated resources.
Circuit switching is quite inefficient as channel capacity is dedicated for the duration of a
connection even if no data is transferred.
Circuit switching is more useful in the case of data exchanges which involve a relatively
continuous flow (Ex. Voice).

Computer Networks & Protocols by S.Meenatchisundaram 85


Switching Techniques
' Message Switching:
Circuit switching has two constraints:
i) Both hosts (or stations) must be available at the same time for the data exchange.
ii) Resources must be available and dedicated through the network between the two
hosts.
.••
An alternative technique used is a store and forward network (message and packet switching).
In store and forward switching, messages are stored at switch nodes or IMP and then
transmitted onwards to their destination. For message switching, no physical (copper) path is
established in advance between the sender and receiver. When a host wants to send a message,
it gives (appends) the destination address to the message. The message is then passed from
node to node through the network. At each switching office (IMP), the entire message is
received, inspected for errors, stored briefly and then transmitted to the next IMP. Thus the
message passes through the network, from link to link queuing at nodal points. A message-
switching IMP is typically a general purpose mini computer with sufficient storage to buffer
messages as they come in (circuit switching IMP can be electronic or electromechanical
switching device which transmit bits as fast as it receives. them). As compared to packet
switching systems, message switching systems can have long messages sent as a single
transmission.

Computer Networks & Protocols by S.Meenatchisundaram 86


Switching Techniques
' Advantage over circuit switching:
i. Increased circuit utilization as a single IMP-to-IMP channel can be shared by many
messages over a time.
ii. Simultaneous availability of sender and receiver is not required.
iii. Message priorities can be established.
.•• iv. Messages can be rerouted avoiding inoperative terminals.
v. When the traffic is heavy, circuit switched network blocks some calls. Where as in
message switched nets, messages are accepted but the delivery delay increases.
vi. Speed and code conversion is possible (ASCII to EBCDIC).

Disadvantage over circuit switching:


i. Not suitable for real time or interactive traffic.
ii. Not useful for voice connections.
iii. Message switching is subjected to buffering or queuing delay. The delay through
the network is relatively long and has relatively high variance (as message may vary
in size)

Computer Networks & Protocols by S.Meenatchisundaram 87


Switching Techniques
Packet Switching:
' It is also a form of store and forward switching, which combines the advantages of message
and circuit switching while minimizing the disadvantages of both. It is very much like message
switching. The major external difference is that the length of the unit data is limited in a
packet switched .network. Typical maximum length range from thousand to several thousand
bits.
.••
In packet switching, the message is divided into packets. The packet is prefaced with an
identifier which contains suitable addressee information and the information that allows the
message is transmitted packet by packet, stored in switching office (IMP) and then forwarded
later, one packet at a time.
Networks employing packet switching usually have a mesh type of topology in which all the
nodes are indirectly connected with each other via links between some adjacent nodes. Packet
switching is suitable for handling interactive traffic where the transmission line is used by a
user only for 10s of millisecond (in message switching, when the message is long, IMPs need
larger buffers and the transmission line usage by a user take seconds or even minutes).
Packet Format:

1 2 3 4 5 User Data

Header
1 – Destination ID, 2 – Source ID, 3 – Message ID, 4 – Packet ID, 5 – Control ID
Computer Networks & Protocols by S.Meenatchisundaram 88
Switching Techniques
There are two basic modes of operation of packet switched communication networks.
'
1) Datagram and 2) Virtual circuit.
Datagram:
Consider a station (host) with message to be sent which is greater than the maximum packet
size. The message is sub divided into packets by the station and sent to its node (IMP).
Datagram is one approach of sending such messages. In this approach, each packet is treated
.••
independently (just as each message is treated independently in a message switched network).
Each datagram must have full destination address.
In fig., host station A has three-packet message to be sent to E. The three packets at its node
6 is routed as per the routing decision of node 6. 'A' gives the packets (a, b, c) to node 6.
Packet a, b, c arrives at node 6 in order and node 6 determines the queue of packets, for
node 5 or 7 (depending on the existing condition, shortest queue is determined). Suppose a,
b are queuing for node 7, then packet c will queue up for node 5. Hence the packets many be
delivered to E in a different sequence from the one in which they were sent. Host E has to
reorder them. i.e. each packet in datagram technique is treated independently. Datagram
delivery will be (i) Quicker (ii) More flexible (iii) More reliable and (iv) uses less set of
protocols. Datagrams are somewhat analogous to telegrams.

Computer Networks & Protocols by S.Meenatchisundaram 89


Switching Techniques
Virtual circuit:
'
In the virtual circuit approach, a logical connection is established before any packets are sent.
Example: In fig., let A has one and more messages to be sent to E. First a call request packet
is made to 6 requesting a connection to E. IMP 6 decides to route the request and all
subsequent data to 7. 7 decides to route the request and all following data to 4. Now the call
request packet has come to E. when E is ready to accept the connection, it sends a call accept
.•• packet to 4 which is passed back via 7, 6 and to A. Now a virtual circuit or logical connection
is established between A and E and exchange of data is done.
Each packet to be sent should have a virtual circuit identifier and the data so as to proper
routing and movement of the packet over the reestablished connection (A-6-7-4-E) and (E-
4-7-6-A).
With a clear request packet, the connection is; terminated. Even though the route is set up
prior to data transfer, it is not a dedicated path as in circuit switching. This is due to the fact
that a packet is buffered at each IMP and queued for output over a line.
Therefore at any time, each station can have (i) more than one virtual circuit to any other
station and (ii) Virtual circuits to more than one station.
Example: Consider the sub network shown in fig.

Computer Networks & Protocols by S.Meenatchisundaram 90


Switching Techniques
'

.••

The possible virtual circuits are listed for the data originating at ‘a’ and at ‘b’.
Originating at ‘a’
0abcd 1af ed
2abed 3af cd

Originating at ‘b’
0bcd 1bed

Computer Networks & Protocols by S.Meenatchisundaram 91


Switching Techniques
Comparison between Switching networks:
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 92


Switching Techniques
1) Propagation delay is the time taken for the signal to propagate from one IMP to the next
' (this is normally negligible).
2) Transmission time is the time taken for transmitter to send out a block of data.
3) Node (IMP) delay (processing delay) is the time taken for a node for processing as it
switches data.
For circuit switching a processing (node) delay is present at each node for setting up the route
.•• connection. This delay is not present for call accepts signals as the connection is already setup.
In message switching, there is no call setup. But entire message must be received at each IMP
before it begins to retransmit i.e. the total delay is longer than for circuit switching.
Virtual circuit packet switching appear similar to circuit switching. Here the call accept signal
incurs delay at each IMP. The reason is this packet is queued at each IMP and has to wait its
turn .before transmitting. Packet switching is slower than circuit switching (as circuit switching
is transparent).
Datagram packet switching performance is vastly improved, as call setup is not needed. It is
faster than message switching, as it need not wait for the entire message. The performance also
depends on
a) Number of stations (hosts) b) Number of nodes c) Total Load
d) Distance between stations e) Processing speed of nodes f) Packet size

Computer Networks & Protocols by S.Meenatchisundaram 93


Switching Techniques
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 94


Switching Techniques
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 95


Example Problems
Example 1:
'
Television channels are 6 MHz wide, How many bits/sec can be sent if four-level digital
signals are used? Assume a noiseless channel.
Solution:
Maximum data rate = 2 Blog2L bits/sec
.••
= 2 x 6 x 106 log2 4 =24 Mbps

Example 2:
Why has the PCM sampling time been set at 125 µsec?
Solution:
Traditional telephone lines carry frequencies between 300 Hz and 3400 Hz. 4 KHz
bandwidth is normally allocated for telephone channel. At the Nyquist rate (2 x 4 KHz) =
8000 samples per sec are generated by the CODEC. For PCM, the samples are taken at
1/8000 interval = 125 µsec.

Example 3:
Calculate the theoretical highest bit rate of conventional telephone line.
Computer Networks & Protocols by S.Meenatchisundaram 96
Example Problems
Solution:
'
A telephone line carries frequencies between 300 Hz and 3400 Hz (BW = 3100 Hz). The
best signal to noise ratio is usually 35 dB to 40 dB for a telephone channel.
Channel capacity at 35 dB SNR = B log2{1 + S/N} = 36.043 kbps

.••
Example 4:
Consider a telephone line of 4 KHz bandwidth. When the signal is 10 volts, the noise is 5
millivolts. What is the maximum data rate supported by this telephone line?
Solution:
Maximum data rate supported = B log2{1 + S/N}
= 4000 log2 {1+10/5x10-3} =43.863 kbps
Example 5:
Given a channel with an intended capacity of 20 Mbps, the bandwidth of the channel is 3
MHz. What signal to noise ratio is required to achieve this capacity?
Solution:
Channel capacity, C = 20x106 bps = B log2{1 + S/N} =3x106 log{1+S/N}
 S/N = 101
Computer Networks & Protocols by S.Meenatchisundaram 97
Example Problems
Example 6:
' 50 computers are multiplexed using synchronous TDM. If each computer sends at the rate
of 28.8 kbps, what is the minimum bit rate of the line? Can a T-l line handle this situation?
What is the bandwidth unutilized?
Solution:
For synchronous TDM, the data rate of the multiplexed line = 50 x 28.8 kbps
.••
= 1.44 Mbps
A T-l carrier can handle a maximum bit rate of 1.544 Mbps. The above situation can be
handled by T-1 line.
The unused data rate/bandwidth = (1.544 - 1.44)Mbps = 104 kbps

Example 7:
An 8in x 10in picture is scanned by a scanner having a resolution of 600 x 600 pixels per
square inch. How many bits are produced if the scanner uses 8 bits/pixel? How many bits
are required if each pixel uses 256 colors?
Solution:
Each square inch has (600 x 600) pixels = (600 x 600 x 8) bits
The picture needs (600 x 600 x 8 x 8 x 10) bits =230.4 Megabits
Computer Networks & Protocols by S.Meenatchisundaram 98
Example Problems
' i.e. scanner produces 230.4 Megabits.
The picture has 256 colors per pixel.
A total of 230.4 x 256 Mega bits are required = 230.4 x 256/8
= 7.373 Giga bytes

.••
Example 8:
A 15 page text matter has been sent by E-mail. Each page has on an average 40 lines and
each line has on an average 60 characters. Each character has been coded by the 8-bit
augmented ASCII code. Calculate the number of frames required to carry the mail, if a
frame can carry at most 3000 bytes.
Solution:
Number of bytes of information in the E-mail =(15x40x60x8)/8=36,000
Number of frames required to carry the E-mail = 36,000 / 3,000 = 12

Computer Networks & Protocols by S.Meenatchisundaram 99


Assignment - 1
' 1) Integrated Services Digital Network (ISDN):
1. ISDN Services.
2. Evolution of ISDN.
3. ISDN system architecture and standards
4. ISDN Interface
.••
5. ISDN Signaling

2) Digital PBX (Private Branch Exchange)

Computer Networks & Protocols by S.Meenatchisundaram 100


Data Link Layer
The data link layer carries out error control, flow control, framing and other functions. Data
' link layer ensures free transfer of bits from one device to the other. The data link layer receives
service from physical layer and provides service to network layer.
Design Issues:
The data link layer has four specific functions that are to be considered while design of layer 2.
They are,
.••
1) Services provided to the network layer (Layer 3):
The data link layer offers service to transfer data (bits) from network layer of source machine
to the network layer of destination machine

Layer - N Layer - N Layer - N Layer - N

Layer - N Layer - N Layer - N Layer - N

Layer - N Layer - N Layer - N


Layer - N
Virtual Data Path
Actual Data Path
Computer Networks & Protocols by S.Meenatchisundaram 101
Data Link Layer
The processes carry out error control, flow control and other link management functions. The
' services offered vary from system to system. They are,
i) Unacknowledged connectionless service:
Here no connection is established or released and there is no acknowledgement of frames
received by the destination machine. Frames lost are not recovered. This service is useful when
the error rate is low and for real time traffic (speech). Most LANs are using this.
.••
ii) Acknowledged connectionless service:
Here each frame sent is acknowledged. If it has not arrived within a specified time interval, it
can be sent again. Unreliable channels (wireless systems) use this type. (Acknowledgement in
the data link layer is not a requirement as the transport layer always waits for the
acknowledgement. The message is sent again if acknowledgement is not received within the
time interval specified).
iii) Acknowledged connection-oriented service:
This is the best service provided by the link layer. With the connection established, each frame
is numbered and sent and there is guarantee of reception at the destination in the right order.
A reliable bit stream is provided to the network layer entities. There are three phases in the
service.
a) Connection establishment b) Frame transfer and c) Connection release freeing variable,
buffers and other resources.
Computer Networks & Protocols by S.Meenatchisundaram 102
Data Link Layer
2) Framing: The first task of data link layer is to format the user data as series of frames each
' having a predetermined structure. It contains user data and control fields. It consists of three
components as (a) Header, (b) Data and (c) Trailer.
HDLC (High level data link control) frame:

F A C Data FCS F

.••
DH HDLC DT
3) Error Control
After the frame formation, all the frames should be delivered to the network layer at the
destination in the proper order. Reliable delivery needs feedback or acknowledgement from the
receiver. Control frames with positive or negative acknowledgement are used. Positive
acknowledgement denotes safe delivery. Negative acknowledgement means retransmission is
needed (due to some error). For the cases of no reaction from the receiver (a frame vanishing),
timers are introduced in the data link layer. In the normal condition the time is sufficient to get
the transmission and. acknowledgement. With no acknowledgement, the sender retransmits the
frame after the timer goes off. Sequence numbers are given to the frames to distinguish the
same frame transmitted many times. Managing timers and sequence numbers is an important
issue of the data link layer.

Computer Networks & Protocols by S.Meenatchisundaram 103


Data Link Layer
4) Flow Control:
' Flow control mechanisms ensure that the data link layer at the sending end does not send more
frames than what data link layer at receiving end is capable of handling. This may happen if
the sender is running on a fast computer or the receiver is running on a slow computer.
Flow control mechanisms control the traffic with some feedback or acknowledgement from
the receiver. The acknowledgement serves two purposes.
.••
i) Clears the sending end to transmit the next frame and
ii) Acknowledges the receipt of all previous frames. Various control schemes /
protocols are used in the data link layer.

Error Detection and Correction:


Errors are introduced in the data bits during transmission. They can be,
i) Content errors - '1' received as '0' or '0' received as '1'.
ii) Flow integrity errors - Refers to missing blocks of data.
For error detection, and correction, check bits are added to a block of data bits. Check bits are
redundant bits, as they carry no user information. Coding is the process of adding the check
bits.

Computer Networks & Protocols by S.Meenatchisundaram 104


Data Link Layer
Bit error rate (BER): In analog transmission, signal quality is specified in terms of SNR in dBs.
' In digital transmission, the quality of received signal is specified in terms of BER. It is the
number of errors in a fixed number of transmitted bits (A good telephone line has 1 error in
106).
CER (character error rate): It is the average number of characters received with at least one
error in a large sample of characters.
.•• FER (Frame error rate): It is the average number of frames received with at least one error in a
large sample of transmitted frames.

Error Detection Methods:


Some of the popular methods are,
i) Parity checking.
ii) Checksum error detection and
iii) CRC (Cyclic redundancy check)

Computer Networks & Protocols by S.Meenatchisundaram 105


Data Link Layer
i) Parity checking:
' Here a parity bit is added to each data word. Even parity when the weight of code formed is
even and odd parity, when the weight of the code formed is odd .
Example:
Even Parity Odd Parity
P Data word P Data word
.••

0 1010110 1 1010110
1 1100010 0 1100010

With single error or more number of errors occurring, the parity of code word is checked at
the receiver. The violation of parity rule indicated errors.
Example:
Transmitted code 11100010 Even Parity
Received code (Single error) 01100010 Odd Parity (error detected)
Received code (Double error) 01101010 Even Parity (error not detected)

Computer Networks & Protocols by S.Meenatchisundaram 106


Data Link Layer
Limitations:
'
i) Double or any even number of error goes undetected (not suitable for multiple errors).
ii) Parity checking does not show the location of the erroneous bit.
iii) Error cannot be corrected with parity checking method.
iv) Parity checking completely fails for the errors occurring in bursts (checksum and CRC can
.••
take care of burst errors).
2) Checksum error detection:
Here a checksum is transmitted along every block of data bytes. Eight bit bytes of a block are
added in an eight-bit accumulator. The resulting sum in the accumulator is the checksum (Here
the carries of MSBs are ignored). After transmitting the data bytes, the checksum is
transmitted. The checksum regenerated at the receiving end will be different if there are errors.
Advantage: (over parity check) Unlike simple parity where even number of errors may not be
deleted, in checksum there is 255 to 1 chance of detecting random errors.
3) Cyclic redundancy check (CRC): CRC codes are very powerful and are very commonly used.
These codes provide a better measure of protection. They can be easily implemented using
shift registers or software. They are also known as polynomial codes.

Computer Networks & Protocols by S.Meenatchisundaram 107


Data Link Layer
' The theory of CRC is derived from a branch of mathematics called algebraic coding theory.
Data block of 'k' bits can be represented by a polynomial in a variable 'x' having ‘k’ terms (i.e.
polynomial of order (k-1)).
The polynomial M(x) is given by
M(x)=ak-1 xk-1 + ak-1 xk-1 +…………………..+a2x2+a1x1+a0x0
.•• Where ak-1, ak-2……….ao are the bits (0 or 1) in the data block.
Let the data message to be sent be 1010001101 then,
M(x) = X9 +(0) x8 +1*x7 + ... +1*xo = (x9+ x7 + x3 + x2 +1) ------------ (1)
Higher order bit is transmitted first. To transmit the data block, a second polynomial called
generating polynomial; G(x) is used. G (x) is of degree ‘r’. 'r' is less than that of M(x), but>0.
Let G(x) = (x5 + x4 + x2 +1) --------------- (2)
The steps or algorithm for computing the checksum are:
i) Let 'r' be the degree of G(x). The data message M(x) is multiplied by xr, giving ‘r’ zero bits to
the low-order end of the frame. i.e. (k + r) bits will be present corresponding to the
polynomial xrM(x).

Computer Networks & Protocols by S.Meenatchisundaram 108


Data Link Layer
ii). The result is divided by G(x) using modulo 2 division (polynomial arithmetic is done).
' According to the rules of algebraic field theory there are no carries for addition and borrows
for subtraction. This gives a unique quotient Q(x) and a remainder R(x).
iii) The remainder is subtracted form the bit stream corresponding to xrM(x) using modulo 2
subtraction.
iv) Call the result (check summed frame for transmission) as polynomial T(x).
.••
Example: Find the CRC for a frame (message) 1010001101 and G (x) is = x5+x4+x +1.
1) ‘r’ = 5 as G(x) is of degree 5.
xrM (x) = X5 (X9+ X7 +X3 +X2 +1) = (X14 +X12 + X8 + X7 + X5)
=101000110100000
2) {xrM(x) / G(x)} gives a remainder of x3 + x2 + x= 01110
110101011
110101|1 0 1 0 0 0 1 1 0 1 0 0 0 0 0
110101
0111011
110101
0011101

Computer Networks & Protocols by S.Meenatchisundaram 109


Data Link Layer
' 00111010
110101
00111110
110101
00101100
.••
110101
0110010
110101
0001110

3) 1010001101|01110 ---------- T(x)


i.e. the polynomial to be transmitted T(x) consists of the data (message) word followed by the
remainder. The code word generated {T(x)} is completely divisible by the divisor. At the
receiver, a non-zero remainder after dividing by the same divisor, G(x) indicates errors in
transmission of the code word. If the remainder is zero, there is no error or an undetectable
error.

Computer Networks & Protocols by S.Meenatchisundaram 110


Data Link Layer
' Undetected errors in CRC:
Not all types of errors can be detected by CRC code. The probability of error detection and
types of error that can be detected depends on the choice of divisor. When a number of bits
are changed by noise, the error may get noticed or unnoticed. Let E(x) be the pattern of error
bits. For a message in error {T(x) + E(x)} will be received. If this is exactly divisible by G(x),
the error goes unnoticed. Hence proper G(x) is to be picked such that the pattern of error bits
.••
will not be divisible by it.
Error Detection Probability:
I) Single Bit Error II) Double Bit Errors
III) Odd number of errors IV) Burst of errors
Some of the common generating polynomials and their applications are,
CCITT V4.l X16 + X12 + x5 +1 used in HDLC / SDLC / ADCCP protocols.
CRC-12 Xl2 + X11 + x3 + x2 + X1 + 1 used in BISYNC protocols .
CRC-16 X16 + X15 + x2+ 1 used in BISYNC protocols.
CRC-32 X32 + x26 + ……. + x+ 1.
CRC-16 catches all single and double bit errors, all errors with an odd number of bits, all burst
errors of length ~ 16.99.998% of 18 bit and longer bursts.

Computer Networks & Protocols by S.Meenatchisundaram 111


Data Link Layer
' Elementary Data Link Protocols:
i) In the various layers (Physical, Data link, Network), independent processes communicate
messages back and forth. This makes communication protocols in different layers evolving
independently resulting in the simplification of software design. This keeps network and link
layer protocols completely separate with a rigid interface between them.
ii) Consider machines A and B. ‘A' is assumed to have continuous supply of data to 'B' and 'B'
.••

can also send data simultaneously.


iii) Source data link layer considers every bit from network layer as pure data for
communication to the destination network layer.
iv) Packet from network layer is encapsulated into a frame by adding header (DH) and trailer
(DT).
Three protocols for the data link layer are considered with increased complexities
1) Unrestricted simplex protocol (Utopia)
2) Simplex stop and wait ARQ protocol.
3) Simplex Protocol for a noisy channel.

Computer Networks & Protocols by S.Meenatchisundaram 112


Data Link Layer
' Unrestricted simplex protocol (Utopia):

Here the data are restricted in one direction. This unrealistic protocol assumes
i) Infinite buffer space.
ii) No processing time
.••
iii) Frames are not lost or damaged in the transit
iv) The network layer at both ends are always ready
v) No errors and flow control restrictions.
The protocol has two procedures, a sender and a receiver for the data link layer. There will be
no sequence numbers and acknowledgements used. (No MAX-SEQ).
The sender's loop has three actions - getting the packet from network layer, frame construction
and frame transmission. Info field is the only field used by this protocol. The receiver data link
layer waits for the frame and data portion is passed on to the network layer. Some of the
procedures needed are: wait-for-event, frame-arrival, from- physical-layer.

Computer Networks & Protocols by S.Meenatchisundaram 113


Data Link Layer
' Simplex stop and wait ARQ protocol:
Most unrealistic restrictions of the protocol are the ignored processing time. Here the buffer
space is not infinite, but the channel is error free and simplex. Flooding of the receiver with
data is to be prevented by providing a feedback to the sender. The receiver sends a dummy
(acknowledgement) frame to the sender and after receiving the acknowledgement, the next
.•• frame is sent. These type of protocols are called stop and wait.
The sender fetches a packet from network layer, constructs a frame and then sends the frame.
Now it waits for the acknowledgement frame and then fetches the next packet from the
network layer.
Some of the procedures used are: from-physical-layer, to-network-layer, from next layer, to-
physical-layer, wait-for-event. Even though data traffic is simplex, frames travel in both
directions. This protocols ensures a strict alternations of flow: sender sends, then the receiver
receives, sender sends, receiver sends and so on. Half duplex channel is more appropriate.
Flow control is the main function in this protocol.
The sequence of events are shown in figure.

Computer Networks & Protocols by S.Meenatchisundaram 114


Data Link Layer
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 115


Data Link Layer
' Simplex protocol for a noisy channel :
This protocol ensures error control as well as flow control. Frames may be lost or damaged in
the communication channel. Damaged frame can be detected at the receiver by check sum
leading to retransmission. A timer is used. If the acknowledgement is received, the frame is
correctly transmitted and no acknowledgement for a damaged frame reception. After the time
out, retransmission is done.
.••

The above said timer arrangement may lead to duplicate frames received due to various factors.
i) Acknowledgement frame lost completely.
ii) Routing problem for the acknowledgement frame.
Once the timer is out, the data link layer sends once again the same frame (which has already
reached the destination correctly). Hence, the link layer has to ensure that no combination of
transmission errors lead to duplicate packet delivered to network layer.
A sequence number in the header of each frame makes it possible for the receiver to
distinguish whether the frame is arriving first time or due to retransmission. After checking the
sequence number, the receiver can discard the duplicate frame.

Computer Networks & Protocols by S.Meenatchisundaram 116


Data Link Layer
A 1-bit sequence number (SN) is normally used in the header of the transmitted frames.
'
Normally a frame is given a SN '0' and the next frame is given the SN '1', then the next SN '0'
and so on. The retransmitted frame arriving at the receiver will give the same SN. Duplicate
frames arrival will have the same SN and are discarded. Frame with the correct SN is accepted
and passed onto the network layer of the destination machine.
Protocols using the above said procedure are called PAR (Positive acknowledgement with
.•• retransmission) or ARQ (Automatic retransmission or repeat request). The data traffic in this
protocol is simplex, but the frames travel in both directions Half-duplex channel is more
appropriate. Premature time outs are to be avoided, other wise duplicate frames are sent.
Some of the additional procedures used are: next-frame-to-send, frame-expected.
The timer has to be set to allow enough time for the frame to reach the receiver; receiver
process time for the worst case and time for acknowledgement to propagate back. This is also
another stop and wait protocol for noisy channel.

Computer Networks & Protocols by S.Meenatchisundaram 117


Data Link Layer
' Sliding Window Protocols:
In the earlier protocols discussed, data frames were moving in one direction and for
acknowledgement in the other direction. Full duplex system is not economical as the
bandwidth of the reverse channel (for acknowledgements) is nearly wasted (full capacity is not
utilized). Buffer utilization is possible with a single circuit (simplex) with data frame in the
forward direction intermixed with acknowledgements in the reverse direction.
.••

In sliding window flow control mechanism, multiple data frames are transmitted without
waiting for acknowledgements of individual data frames. This is known as piggy backing. 'A'
sends a message to 'B'. 'B' does not send any frame exclusively for sending acknowledgement,
but uses a message frame going from 'B' to 'A'. Here the delayed acknowledgement is attached
to an outgoing data frame (separate control frame is not sent). The piggy back field needs a
few bits in the frame header and hence the available channel bandwidth is well utilized. How
long the data link layer has to wait is one of the issues. The synchronization is needed to face
any combination of garbled frame, lost frame and premature time outs.
Sliding window protocols takes care of most of the above said problems. They are robust and
work in all conditions.

Computer Networks & Protocols by S.Meenatchisundaram 118


Data Link Layer
Sequence numbering of the frames:
'
All data frames are given a sequence number from '0' to a maximum number, which is a binary
number of a fixed number of bits. Maximum is (2n - 1) and the sequences start again from the
beginning. No sequence number is repeated within the window. n=1 is the stop and wait
sliding window protocol. Sophisticated versions use arbitrary 'n'.
The sender has a set of sequence numbers to the permitted frames and these falls within the
.••
sending window. The receiving window is maintained at the receiver to the set of frames it is
permitted to accept. The window size has no restrictions. They can be fixed or variable.
The sequence number within the sender's window represents frames sent but yet not
acknowledged. The new packet arriving is given the next highest sequence number and the
upper edge of window is advance by one. With acknowledgement coming in, the lower edge is
advance by one. The window maintains a list of unacknowledged frame. The sender needs ‘n’
buffers to hold unacknowledged frames. At the receiver any frame outside the window is
discarded. The receiver's window always remains at its initial size where as the sender's window
size need not be at its initial size.
The operation of the flow control mechanism is illustrated in Fig.
Sending end maintains a window of fixed size. A copy of the frame is retained in the window
till acknowledged.

Computer Networks & Protocols by S.Meenatchisundaram 119


Data Link Layer
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 120


Data Link Layer
' RR-N  Ack with N, the number of next frame expected to receive. (N-1) frames are
acknowledged. Receiver not ready (RNR) acknowledgement is used to stop the transmission
temporarily. RNR-9 means acknowledgement upto 8. RR: Receiver ready.

One-bit sliding window protocol:


.••
This protocol defines some variables such as next-frame-to-send, frame-expected. 0 and 1 are
the only possibilities for one-bit protocol. Other procedures used are to- physical-layer, start-
timer.
Consider stations A and B as shown in Fig. Two scenarios are considered.
1) Normal Operation:
Let A start first i.e., A fetches the first packet (and B waits) from its network layer and a frame
is formed and sent. Once the frame is arrived, the receiver (B) accepts and the frame is passed
to the network layer of B (now the receiver window slides up). The acknowledgement field
consists the number of last frame received the sequence number of the frame sent. Now the
sender (A) can fetch the next packet from its network layer. When the sequence number
disagrees, the same frame is sent. The protocol is highly resilient. Duplicate packets are not
delivered to either network layer, no packet is skipped and there will be no deadlock under any
condition.
Computer Networks & Protocols by S.Meenatchisundaram 121
Data Link Layer
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 122


Data Link Layer
2) When both A and B stations initiate communication simultaneously :
' Synchronization problem exists resulting in many duplicate frames even though , there are no
transmission errors or due to premature timeouts. With simultaneous initial communication
between A and B, their first frames cross leading to synchronization problem.

.••

Computer Networks & Protocols by S.Meenatchisundaram 123


Data Link Layer
Goback-n ARQ protocol:
'
In the earlier protocols: the round trip propagation delay (for transmission and for the
reception of acknowledgement) is neglected. In certain cases, the round-trip delay is crucial in
view of
(i) Efficiency and
(ii) Bandwidth utilization.
.••

Example: Round trip propagation delay in satellite link (illustrated in Fig.), range from 200 to
540msec (depending on LEO, MEO, or GEO synchronous orbit). Consider 50Kbps channel
with 500msec round trip propagation delay. A 1000 bit frame needs (1000 / 50Kbps) =
20msec to complete frame transmission.
Acknowledgement is obtained after (20+250+250) millisecond (Note: acknowledgement
packet is small). 500 out off 520msec is used for propagation and, 96% of the time is blocking
the sender in the stop and wait protocol or 4% of the available bandwidth is gainfully utilized
leading to poor efficiency.
Goback-n sliding protocol provides solution to the above said problem of inefficiency. Here
the sequence (SN) number field is wide enough to represent a fairly large number (In the
previous protocol SN field is 1-bit wide). The sender is allowed to transmit continuously up to
'W' frames before blocking instead of '1'. The best choice of 'w' equal to round-trip
transmission time without filling up the window.
Computer Networks & Protocols by S.Meenatchisundaram 124
Data Link Layer
'

.••

For example (W = 520/20 = 26). At t = 520msec, the acknowledgement for frame '0' will have
arrived and the acknowledgements at 20msecs interval. The sender is always permitted to
continue transmission of frames when it needs. (Maximum window size for the example
considered = 26).
Pipe lining:
The above technique is known as pipe lining. Let the channel capacity be 'b' bps, frame size 'L'
bits and round trip delay 'R' sec. Then L/b sec = time required for single frame transmission.
After (L / b + R / 2) see, the complete frame is received and after (L/b + 2R / 2) sec, the
acknowledgement is received by the sender. For stop and wait protocol, the line utilization =
L/b / (L/b +R) = (L / L + Rb). For L.= bR, efficiency will be 50% and < 50 % for L < bR
with pipe lining, the line can be kept busy.
Computer Networks & Protocols by S.Meenatchisundaram 125
Data Link Layer
Problems with pipe lining:
'
When the communication channel is unreliable or noisy, a frame may be lost or damaged in the
middle of a long stream of frames. The receiver has to discard the damaged frame and the
sender has to be intimated. There are two approaches:
a) Goback-n is one of the approach:
In this approach, the receiver discards all subsequent frames (after the error) with no
.••
acknowledgements for the discarded frames. After the sender's time runs out, the sender
retransmit all unacknowledged frames in order, starting with the damaged or lost one. This
causes wastage of bandwidth when the error rate is high. The effect of an error (E) is shown
in Fig. when the receiver window size is 1.

Computer Networks & Protocols by S.Meenatchisundaram 126


Data Link Layer
i.e. In pipelining protocol (Goback-n), the receiving link layer accepts frames in order and
' frames following an error are discarded. Some of the library events and procedures used are
network layer-ready, enable-network-layer, and disable-network layer to enforce flow control
for MAX-SEQ. Maximum number of outstanding frames are always restricted to MAX-SEQ.
Buffering: is needed in this protocol. After an error, the sender has to retransmit all
unacknowledged frames at a later stage, these frames are to be retained till they are accepted by
the receiver. With acknowledgment coming in for frame n, previous frames (n-l, n-2, ..... ) are
.••
automatically acknowledged.
Multiple timers (one per outstanding frame) are needed as the protocol has multiple
outstanding frames. These timers are simulated in software using a single hardware clock.
(b) Selective repeat sliding window protocol :
The second approach for handling errors in the presence of pipe lining is called selective
repeat. Goback-n protocol has poor, bandwidth utilization if errors, are more due to poor line
quality. In this protocol, frames are not discarded after an error is detected. The receiver
buffers the frame following a lost or damaged frame and the sender retransmits only the
erroneous frame (and not all its successors as in Goback-n protocol). This approach needs
receiver window larger than 1 and hence require large amounts of data link layer memory.
Frames within the window are accepted and buffered until all the preceding ones are delivered
to the network layer of the receiver.

Computer Networks & Protocols by S.Meenatchisundaram 127


Data Link Layer
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 128


Medium Access Sub layer
Medium Access Sub layer:
' Broadly there are two types of networks. They are,
i) Point-to-point ii) Broadcast networks
Broadcast networks are considered in this chapter. Consider a single broadcast channel used by
many users. FDM is one way of allotting, which is simple and efficient allocating mechanism.
As data traffic in most computer system is bursty (peak to mean traffic ratio 1000 : 1 are
common), most of the channel will be idle most of the time. With TDM, allocated slot will be
.••

idle most of the time.


With a single channel available and multi user, determining who should use first and then next
is very difficult. Many protocols are in use for solving this problem. MAC (medium access
control) protocol is needed for a multi access network. These protocols are designed to address
the problem of how to share a common broadcast channel. The techniques used are known as
random access or contention techniques. (Random access means: stations generate packets for
transmission at random time's and there is no predictable or scheduled time for any station to
transmit).
Note: MAC sub layer is the bottom of data link layer.
MAC is important in LANs. Almost all of the LANs use a multi access channel. The three
random access or contention protocols extensively used for pocket radio networks are:

Computer Networks & Protocols by S.Meenatchisundaram 129


Medium Access Sub layer
i) ALOHA
' ii) Slotted ALOHA
iii) CSMA (Carrier Sense Multiple Access)
ALOHA Protocols:
ALOHA was the first computer system to employ radio instead of wires for its
communication. It is a satellite-based network developed in 1970 at the university (N.
Abramson and others) of Hawaii. They used ground based radio broadcasting. However
.••

ALOHA is applicable to any transmission medium shared by uncoordinated users. ALOHA


uses packet switching on a radio broadcast channel.
Pure ALOHA:
ALOHA or pure ALOHA is a true free-for-all. Here the packets are not being sent in FDMA
or TDMA. (MA  multiple access). The user is neither allotted a narrow bandwidth as in
FDMA nor has to wait his turn as in TDMA. Here the stations need no synchronization.
Basic Principle:
A station sends a packet and waits for an amount of time equal to maximum possible round
trip propagation time on the network. If the station hears an acknowledgement during this
period, fine, otherwise it resends the packet. After repeated failures, it gives up.

Computer Networks & Protocols by S.Meenatchisundaram 130


Medium Access Sub layer
'

.••

A receiving station checks the correctness of the incoming packet and acknowledges. The
packet may be invalid due to noise or due to collision. Packet collision is due to packets from
different stations (overlapping or interfering) with each other at the channel. To avoid collision,
the interval of retransmission is randomized for each station. ALOHA scheme is shown in Fig.
When there is collision, the receiving station ignores the frame transmitted. With a LAN, the
feedback of acknowledgement is immediate. Whereas with a satellite, a delay of 270msec is
needed before the sender gets the acknowledgement.
Fig. shows three stations that transmit packets at random times. Note: Equidistant stations are
considered in the Fig.

Computer Networks & Protocols by S.Meenatchisundaram 131


Medium Access Sub layer
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 132


Medium Access Sub layer
Channel efficiency / utilization in pure ALOHA:
' It is assumed that
i) All frames (packets) are of equal length.
ii) Arrival of message (offered load) follows Poisson's distribution.
iii) Channel is noise free.
Let S be the throughput of the network (or system) i.e. the total rate of data being successfully
transmitted between stations  carried load and G be the total rate of data presented to the
.••

system for transmission i.e. load offered to the system  Channel load.
If λ is the mean arrival rate per unit time, G= λ t in a given time, t.
Total traffic of the channel = New packets (frames) + packets that has to be retransmitted due
to collision.
Then G = [S + number of retransmitted packets per unit]. It is assumed that G has Poisson
distribution. The probability that k frames (packet) are arriving in a given frame time, t is given
by

Computer Networks & Protocols by S.Meenatchisundaram 133


Medium Access Sub layer
Performance of pure ALOHA:
' S=Ge-2G, Smax=0.184 when G=0.5

.••

best utilization of the channel is around 18% as illustrated in Fig.


P0=e-2G=Ge-2(0.5)=e-1=0.368  No traffic probability  Empty slot
The remaining portion will have collision as shown in Fig.

Computer Networks & Protocols by S.Meenatchisundaram 134


Medium Access Sub layer
' Slotted ALOHA:
Maximum throughput (S) with pure ALOHA is only 0.184. To improve the efficiency, a
modification of ALOHA, Slotted ALOHA (S-ALOHA) was developed by Roberts in 1972. In
pure ALOHA system, transmissions begin at completely random times. In slotted ALOHA
system, packets begin transmission at the slot of a clock interval. Here each transmission
control unit has to be synchronized to the clock.
.••

Disadvantage: packet must be of fixed length.


Advantage: vulnerable period is of packet length 1 and the capacity is doubled as compared to
pure ALOHA.
For S-ALOHA, the channel is divided into uniform time slots and each slot (time) size = the
packet or frame transmission time. All users (stations) are synchronized by a centrally
controlled clock. Transmission is allowed only at the beginning of a slot boundary. This avoids
partial overlapping as compared to pure ALOHA

Computer Networks & Protocols by S.Meenatchisundaram 135


Medium Access Sub layer
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 136


Medium Access Sub layer
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 137


Medium Access Sub layer
' CSMA (Carrier sense multiple access):
With slotted ALOHA networks the best channel utilization that can be achieved is 1/e =
0.368. LANs can achieve better utilization than 1/e and various LAN protocols and standards
are available for this.
CSMA is also known as listen before talk (LBT). When a station wants to transmit, it first
.••
listens to the medium (channel) to determine if another transmission is in progress. If the
medium is idle (free), the station transmits otherwise, it waits for some period of time and tries
once again. Collision occurs when two or more stations try to transmit. The station tries all
over again (Refer to flow chart).
With CSMA, protocol is needed to specify what a. station should do when the medium is
found to be busy. The three CSMA protocols are,
1. Non-Persistent CSMA.
2. 1 – Persistent CSMA.
3. P – Persistent CSMA.

Computer Networks & Protocols by S.Meenatchisundaram 138


Medium Access Sub layer
'

.••

Computer Networks & Protocols by S.Meenatchisundaram 139


Medium Access Sub layer
Non-persistent CSMA:
A station wishing to transmit listens and follows the following rules.
a) If the medium is idle, transmit.
b) If the medium is busy, try again after a random delay and repeat step (a).
This delay time is drawn from a probability distribution. This reduces the probability of
collision. However, when. several stations wish to send packets, some idle time may be wasted
before transmission.

1-Persistent CSMA: This protocol avoids channel idle time. The following rules are followed.
a) If the medium is idle, transmit.
b) If the medium is busy, continue to listen until the channel is sensed idle and
transmit immediately .
c) With a collision, wait for a random amount of time and repeat (a). With this
protocol used, the collision is guaranteed when two or more stations are waiting to
transmit.
(Note: Non-persistent stations are differential and 1 – persistent stations are selfish)

Computer Networks & Protocols by S.Meenatchisundaram 140


Medium Access Sub layer
P-persistent CSMA:
This protocol tries to get the compromise of non-persistent CSMA and 1-persistant CSMA
types. (i.e. reduce collisions as well as idle time). The rules are
a) If the medium is idle, transmit with a probability P, otherwise delay on time unit with
probability (l-P).
b) If the medium is busy, continue to listen until the channel is idle and repeat step (a).
c) If the transmission is delayed one time unit, repeat step (a). Effective value of P depends on
load.
All the three approaches are shown in the Fig.

Computer Networks & Protocols by S.Meenatchisundaram 141


Medium Access Sub layer
P-persistent CSMA:
Performance depends on the persistence policy. Non-persistent CSMA is easier to analyze.
Total throughput (S) versus offered load (G) or traffic gives comparison of CSMA and
ALOHA protocols. Fig. shows the performance for all CSMA protocols and ALOHA
protocols.
S = G/( G+1 ) for Non-persistent CSMA.

Computer Networks & Protocols by S.Meenatchisundaram 142


Medium Access Sub layer
CSMA / CD: (CSMA with collision detection):
This protocol is a refinement of CSMA. This is most commonly used medium access control
(MAC) technique for bus / tree LAN topologies. It tries to over come some of the
inefficiencies of CSMA. Under CSMA, when two packets collide the medium remains
unusable for the duration of transmission of both damaged packets. This leads to wastage of
time and bandwidth. This wastage can be reduced by quickly terminating transmission upon
collision. This is done in CSMA / CD protocol.
For CSMA/CD protocol, two more rules are to be added to the CSMA rules.
a) If a collision is detected during transmission, transmit a brief jamming signal for all
stations to know that there has been a collision.
b) After transmitting the jamming signal, wait for a random amount of time, and attempt to
transmit again using CSMA.

Assignment – 2: LAN Standards:


1. Introduction
2. 802.4 – Token Bus
3. 802.5 – Token Ring

Computer Networks & Protocols by S.Meenatchisundaram 143


Network Layer
Network layer is primarily responsible for the muting function of the subnet. It is the lowest
layer that deals with end-to-end transmission. Topology of the subnet is to be known for
choosing the appropriate path from source to the destination.. Overloading, congestion and
deadlock is to be avoided while routing the packets.

Network Layer Design Issues:


a) Services provided to the transport layer:
Network layer provides service at the N/T layer interface. i.e. between the carrier and the
boundary subnet (customer). In switched connections, the subnet resources are shared and
allocated temporarily at the request of end systems. The carrier delivers packets from source to
destination.
Same of the network layer service goals are,
i) Services to be independent of subnet technology.
ii) Transport layer to shielded from the channels of subnet.
iii) Uniform numbered network addresses to be given to the transport layer.
Two services are possible:

Computer Networks & Protocols by S.Meenatchisundaram 144


Network Layer

Computer Networks & Protocols by S.Meenatchisundaram 145


Network Layer
b) Internal organization of network layer
Organization of subnet (network layer) depends on the two classes of service offered. Virtual
circuit for connection oriented services and datagram for connectionless service.
In virtual circuit approach, packets are delivered to the destination over a fixed route, which is
established in advance at the request of the users.
A datagram is a packet of data with address of a destination. Datagram are sent out from one
node to the other through the sub network. At each node, a routing decision is taken for each
datagram. Datagrams can take different routes to reach the destination through the sub
network.

Computer Networks & Protocols by S.Meenatchisundaram 146


Network Layer

Computer Networks & Protocols by S.Meenatchisundaram 147


Network Layer
Routing, Routing (Procedures) Algorithms:

Computer Networks & Protocols by S.Meenatchisundaram 148


Network Layer
Flow based Routing:
In the shortest path routing, the load - and heavy traffic is not taken into consideration. When
the traffic is heavy, the load on the shortest path is reduced by splitting the traffic over several
paths. Flow-based algorithm considers both topology and load.
In a subnet, average traffic for a given line is known in advance. It is easier to analyze, optimize
mathematically to find the mean packet delay on a line from queuing theory. From the mean
delays on all the lines, a flow-weighted average can be calculated for the subnet and the routing
is done that leads to minimum average delay for the subnet.
With the knowledge of line capacity, C in bps (between two nodes), mean flow (Lambda) in
pac/sec, mean packet size (1/µ) in bits and topology,. the mean delay can be calculated from
T(sec) = (1 / (µC - Lambda)).
Example: Consider a Four-node subnet shown in Fig. Lambda can be calculated if the traffic
matrix is available and a routing (tentative) already applied.
Let line AB carries 8 pac/sec, AD 6 pac/sec, Lambda for line AB = (8+4)= 12 Pac/sec as it
carries 8 for AB and 4 for ABC. Assume mean packet size of 500 bits. The analysis is
tabulated as shown in Fig (c) and Fig (b) shows the routing matrix.

Computer Networks & Protocols by S.Meenatchisundaram 149


Network Layer

i Line Pac/sec Ci (Kbps) Ti (msec) Weight


1 AB 12 20 35.7 0.324
2 BC 12 10 125 0.324
3 CD 7 10 77 0.187
4 AD 6 20 29 0.163

Computer Networks & Protocols by S.Meenatchisundaram 150

S-ar putea să vă placă și