0% found this document useful (0 votes)
376 views39 pages

CN Unit 1 Notes

The document discusses fundamentals and the link layer of computer networks. It covers building a network by defining requirements, layering and protocols. The key points are: 1) Building a network involves defining what it is and understanding how it helps meet business objectives. Physical components include PCs, interconnections, switches, and routers. 2) Requirements considered are the services needed by applications, easy network operation, and cost-effective design. 3) The OSI model divides network functionality into 7 layers, with the bottom 3 forming the network support layer, layer 4 as transport, and top 3 as user support. Data exchange uses each layer for specific functions like framing at the data link level.

Uploaded by

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

CN Unit 1 Notes

The document discusses fundamentals and the link layer of computer networks. It covers building a network by defining requirements, layering and protocols. The key points are: 1) Building a network involves defining what it is and understanding how it helps meet business objectives. Physical components include PCs, interconnections, switches, and routers. 2) Requirements considered are the services needed by applications, easy network operation, and cost-effective design. 3) The OSI model divides network functionality into 7 layers, with the bottom 3 forming the network support layer, layer 4 as transport, and top 3 as user support. Data exchange uses each layer for specific functions like framing at the data link level.

Uploaded by

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

JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

UNIT I
FUNDAMENTALS & LINK LAYER
SYLLABUS:
Building a network – Requirements – Layering and protocols – Internet Architecture – Network
software – Performance ; Link layer Services – Framing – Error Detection – Flow control

Building a network:
A computer network or data network is a telecommunications network which allows computers to
exchange data. In computer networks, networked computing devices pass data to each other along
network links (data connections).
Data is transferred in the form of packets. The connections between nodes are established using either
cable media or wireless media. The bestknown computer network is the Internet.
To build a computer network is defining what a network is and understanding how it is used to help a
business meet its objectives. A network is a connected collection of devices and end systems, such as
computers and servers, which can communicate with each other.
These are the four major categories of physical components in a computer network:
Personal computers (PCs): The PCs serve as endpoints in the network, sending and receiving
data.
Interconnections: The interconnections consist of components that provide a means for data to
travel from one point to another point in the network.
This category includes components such as the following:
Network interface cards (NICs) that translate the data produced by the computer into a
format that can be transmitted over the local network .
Network media, such as cables or wireless media, that provide the means by which the
signals are transmitted from one networked device to another.
Connectors that provide the connection points for the media.
Switches: Switches are devices that provide network attachment to the end systems and intelligent
switching of the data within the local network.
Routers: Routers interconnect networks and choose the best paths between networks.

Network User Applications: The key to utilizing multiple resources on a data network is having
applications that are aware of these communication mechanisms. Although many applications are
available for users in a network environment, some applications are common to nearly all users.

The most common network user applications include the following:

E-mail: E-mail is a valuable application for most network users. Users can communicate•
information (messages and files) electronically in a timely manner, to not only other users in the
same network but also other users outside the network (suppliers, information resources, and

1
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

customers, for example). Examples of e-mail programs include Microsoft Outlook and Eudora by
Qualcomm.

Web browser: A web browser enables access to the Internet through a common interface. The
Internet provides a wealth of information and has become vital to the productivity of both home
and business users. Communicating with suppliers and customers, handling orders and fulfillment,
and locating information are now routinely done electronically over the Internet, which saves time
and increases overall productivity. The most commonly used browsers are Microsoft Internet
Explorer, Netscape Navigator, Mozilla, and Firefox.

Instant messaging: Instant messaging started in the personal user-to-user space;• however, it
soon provided considerable benefit in the corporate world. Now many instant messaging
applications, such as those provided by AOL and Yahoo!, provide data encryption and logging,
features essential for corporate use.

Collaboration: Working together as individuals or groups is greatly facilitated when the


collaborators are on a network. Individuals creating separate parts of an annual report or a business
plan, for example, can either transmit their data files to a central resource for compilation or use a
workgroup software application to create and modify the entire document, without any exchange
of paper. One of the best-known traditional collaboration software programs is Lotus Notes. A
more modern web-based collaboration application is a wiki.

Database: This type of application enables users on a network to store information in• central
locations (such as storage devices) so that others on the network can easily retrieve selected
information in the formats that are most useful to them. Some of the most common databases used
in enterprises today are Oracle and Microsoft SQL Server .

Requirements:
An application programmer would list the services that his or her application needs—for example, a
guarantee that each message the application sends will be delivered without error within a certain amount
of time or the ability to switch gracefully among different connections to the network as the user moves
around.

A network operator would list the characteristics of a system that is easy to administer• and manage—
for example, in which faults can be easily isolated, new devices can be added to the network and
configured correctly, and it is easy to account for usage.

A network designer would list the properties of a cost-effective design—for example, that network
resources are efficiently utilized and fairly allocated to different users. Issues of performance are also
likely to be important. This section attempts to distill these different perspectives into a high-level.

2
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Layering and protocols:


OSI Architecture: ISO defines a common way to connect computer by the architecture called Open
System Interconnection(OSI) architecture.

Network functionality is divided into seven layers.•

Summary of layer functions

3
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Organization of the layers :

The 7 layers can be grouped into 3 subgroups

1. Network Support Layers

Layers 1,2,3 - Physical, Data link and Network are the network support layers. They deal with the physical
aspects of moving data from one device to another such as electrical specifications, physical addressing, transport
timing and reliability.

2. Transport Layer:

Layer4, transport layer, ensures end-to-end reliable data transmission on a single link.

3. User Support Layers

Layers 5,6,7 –Session, presentation and application are the user support layers.They allow Interoperability
among unrelated software systems.

An Data exchange using the OSI model:

Functions of the Layers


1. Physical Layer:

The physical layer coordinates the functions required to transmit a bit stream over a physical medium.

4
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

The physical layer is concerned with the following:

Physical characteristics of interfaces and media - The physical layer defines the characteristics of the
interface between the devices and the transmission medium.
Representation of bits - To transmit the stream of bits, it must be encoded to signals. The physical layer
defines the type of encoding.
Data Rate or Transmission rate - The number of bits sent each second – is also defined by the physical
layer.
Synchronization of bits - The sender and receiver must be synchronized at the bit level Their clocks
must be synchronized.
Line Configuration - In a point-to-point configuration, two devices are connected together through a
dedicated link. In a multipoint configuration, a link is shared between several devices.
Physical Topology - The physical topology defines how devices are connected to make a network.
Devices can be connected using a mesh, bus, star or ring topology.
Transmission Mode - The physical layer also defines the direction of transmission¬ between two
devices: simplex, half-duplex or full-duplex.

2. Data Link Layer

It is responsible for transmitting frames from one node to next node.

Relationship of the Data link layer to the Network and Physical layer:

5
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

The other responsibilities of this layer are :

Framing - Divides the stream of bits received into data units called frames.
Physical addressing – If frames are to be distributed to different systems on the n/w , data link layer adds
a header to the frame to define the sender and receiver.
Flow control- If the rate at which the data are absorbed by the receiver is less than the rate produced in
the sender ,the Data link layer imposes a flow ctrl mechanism.
Error control- Used for detecting and retransmitting damaged or lost frames and to¬ prevent duplication
of frames. This is achieved through a trailer added at the end of the frame.
Access control -Used to determine which device has control over the link at any given time.

3. NETWORK LAYER

It is mainly required, when it is necessary to send information from one network to another.

Relationship of the Network layer to the Transport and Data link layer:

The other responsibilities of this layer are :

Logical addressing - If a packet passes the n/w boundary, we need another addressing system for source
and destination called logical address.
Routing – The devices which connects various networks called routers are responsible for delivering
packets to final destination.

4. TRANSPORT LAYER

It is responsible for Process to Process delivery. It also ensures whether the message arrives in order or
not.

6
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Port addressing - The header in this must therefore include a address called port address. This layer gets
the entire message to the correct process on that computer.
Segmentation and reassembly - The message is divided into segments and each segment is assigned a
sequence number. These numbers are arranged correctly on the arrival side by this layer.
Connection control - This can either be connectionless or connection-oriented. The connectionless treats
each segment as a individual packet and delivers to the destination. The connection-oriented makes
connection on the destination side before the delivery. After the delivery the termination will be
terminated.
Flow and error control - Similar to data link layer, but process to process take place.

Transport layer (example)

5. SESSION LAYER

This layer establishes, manages and terminates connections between applications.

7
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Relationship of the session layer to the transport and presentation layer:

The other responsibilities of this layer are :

Dialog control - This session allows two systems to enter into a dialog either in half duplex or full
duplex.
Synchronization-This allows to add checkpoints into a stream of data.

6. PRESENTATION LAYER

It is concerned with the syntax and semantics of information exchanged between two systems.

Relationship of the presentation layer to the application and session layers:

The other responsibilities of this layer are:

Translation – Different computers use different encoding system, this layer is responsible for
interoperability between these different encoding methods. It will change the message into some common
format.

8
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Encryption and decryption-It means that sender transforms the original information to¬ another form
and sends the resulting message over the n/w. and vice versa.
Compression and expansion-Compression reduces the number of bits contained in the¬ information
particularly in text, audio and video.

7. APPLICATION LAYER

This layer enables the user to access the n/w. This allows the user to log on to remote user.

Relationship of the application layer to the user and the presentation layer:

The other responsibilities of this layer are :

FTAM(file transfer,access,mgmt) - Allows user to access files in a remote host.


Mail services - Provides email forwarding and storage.
Directory services - Provides database sources to access information about various sources and objects.

The interaction between layers in the OSI model

9
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Internet Architecture:
The Internet architecture, which is also sometimes called the TCP/IP architecture after its two main
protocols,TCP/IP & UDP .
The Internet architecture evolved out of experiences with an earlier packet-switched network called the
ARPANET. Both the Internet and the ARPANET were funded by the Advanced Research Projects
Agency (ARPA), one of the research and development funding agencies of the U.S. Department of
Defense.
The Internet and ARPANET were around before the OSI architecture, and the experience gained from
building them was a major influence on the OSI reference model. Internet architecture is by definition a
meta-network, a constantly changing collection of thousands of individual networks intercommunicating
with a common protocol.
The Internet's architecture is described in its name, a short from of the compound word "inter-
networking". This architecture is based in the very specification of the standard TCP/IP protocol, designed
to connect any two networks which may be very different in internal hardware, software, and technical
design.
Once two networks are interconnected, communication with TCP/IP is enabled end-to-end, so that any
node on the Internet has the near magical ability to communicate with any other no matter where they are.
This openness of design has enabled the Internet architecture to grow to a global scale.
TCP/IP was developed prior to the OSI model. It is developed with four layers:
Host-to-network layer (Physical & data link)
Internet layer (network)
Transport layer (Part of session & Transport)
Application layer (Session, Presentation & Application)
TCP/IP and OSI model

10
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

1.Host-to-network layer
It does not define any specific protocol. It supports all the standard and proprietary protocols. A network
in a TCP/IP internetwork can be a LAN or a WAN.

2.Internet layer (network)


TCP/IP supports the Internetworking Protocol. IP, uses four supporting protocols: ARP,RARP, ICMP, and
IGMP

Internetworking Protocol (IP)

The IP is the transmission mechanism used by the TCP/IP protocols. It is an unreliable and
connectionless protocol-a best-effort delivery service.
The term best effort means -IP assumes the unreliability of the underlying layers and does its best
to get a transmission through to its destination
IP transports data in packets called datagrams, each of which is transported separately. Datagrams
can travel along different routes and can arrive out of sequence

Address Resolution Protocol:


ARP is used to find the physical address of the node when its Internet address is known.
Reverse Address Resolution Protocol:
The RARP allows a host to discover its Internet address when it knows only its physical address.
Internet Control Message Protocol
11
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

The ICMP is a mechanism used by hosts and gateways to send notification of datagram problems
back to the sender. ICMP sends query and error reporting messages.
Internet Group Message Protocol:
The IGMP is used to facilitate the simultaneous transmission of a message to a group of recipients.

3.Transport layer (Part of session & Transport)


The transport layer was represented in TCP/IP by two protocols: TCP and UDP.UDP and TCP are
transport level protocols responsible for delivery of a message from a process to another process
User Datagram Protocol
The UDP is the simpler of the two standard TCP/IP transport protocols. It is a process-to-
process protocol that adds only port addresses, checksum error control, and length information to the data
from the upper layer.
Transmission Control Protocol
TCP divides a stream of data into smaller units called segments. Each segment includes a sequence
number for reordering after receipt, together with an acknowledgment number for the segments received.
Segments are carried across the internet inside of IP datagram.
Stream Control Transmission Protocol
The SCTP provides support for newer applications such as voice over the Internet. It is a
transport layer protocol that combines the best features of UDP and TCP .

4.Application layer (Session, Presentation & Application)


The application layer in TCPIIP is equivalent to the combined session, presentation, and application layers
in the OSI model.

Network software:
Networking software, in the most basic sense, is software that facilitates, enhances or interacts
with a computer network. One type of networking software allows computers to communicate with
one another, while another type of networking software provides users access to shared programs.
Networking software is a key component of today's computer networks, including the Internet.
Understanding the types of networking software is the first step in understanding how your
computer network really works.

Performance:
Network performance is measured in two fundamental ways: bandwidth (also called throughput) and
latency (also called delay). The bandwidth of a network is given by the number of bits that can be
transmitted over the network in a certain period of time. Bandwidth and throughput are two of the most
confusing terms used in networking.
Latency = Propagation+Transmit+Queue+Processing Propagation = Distance/SpeedOfLight Transmit =
Size/Bandwidth

12
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Network delay is an important design and performance characteristic of a computer network; it specifies how long it takes
for a bit of data to travel across the network from one node to another. It is typically measured in multiples or fractions of
seconds.

Network engineers divide the delay into several parts:

• Propagation delay - time for a signal to reach its destination


• Processing delay - time routers take to process the packet header
• Queuing delay - time the packet spends in routing queues
• Transmission delay - time it takes to push the packet's bits onto the link

Thus, we can calculate the total delay of a network using the following formula:

Delay (or latency) = propagation delay + transmission delay

+ processing delay + queuing delay.

Link layer Services:


The main task of the data link layer is that it transfers data from the network layer of one machine to the
network layer of another machine. This is a part of the services it gives to the upper layer. If you
remember, above the data link layer, we have the network layer.
The data link layer gives a service to the network layer, and this service is the transfer of data from one
network layer to the other, and this in turn uses the physical layer. It converts the raw bit stream of the
physical layer into groups of bits or frames.
DLL offers unacknowledged connectionless and acknowledged connectionless services.
In unacknowledged connectionless, there is no attempt to recover lost frame and there is no
acknowledgement from the other side. It is suited for low error rate networks or for fault tolerant
applications such as voice. By voice tolerant application, we mean that even if some of the bits in a
digitized voice stream drop, there will be some degradation on the other side. But to the human ear, it is
imperceptible. That is why it is fault-tolerant.
In acknowledged connectionless service, each frame is acknowledged by the receiver and it is suited for
unreliable channels, where acknowledgement is required for special reliability.Acknowledged connection-
oriented service ensures that all frames are received and each is received exactly once and these services
are accomplished using simplex not the usual, but half-duplex or full-duplex channels. These are some
examples. It is a reliable message stream. It may be connection-oriented service or connectionless service.
It may be a reliable message stream (sequence of pages) or reliable byte stream (reliable login): in the
latter it is coming byte by byte and in the former, it is page by page.
An example of unreliable connection is digitized voice; unreliable datagram (electronic junk mail) is
connectionless `service.

13
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Framing:
To transmit frames over the node it is necessary to mention start and end of each frame. There are three
techniques to solve this frame

1. Byte-Oriented Protocols (BISYNC, PPP, DDCMP)

2. Bit-Oriented Protocols (HDLC)

3. Clock-Based Framing (SONET)

1. Byte Oriented protocols:

In this, view each frame as a collection of bytes (characters) rather than a collection of bits. Such a byte-
oriented approach is exemplified by the BISYNC (Binary Synchronous Communication) protocol and the
DDCMP (Digital Data Communication Message Protocol)

Sentinel Approach: (a) BISYNC (Binary Synchronous Communication) : The BISYNC protocol illustrates
the sentinel approach to framing; its frame format is

The beginning of a frame is denoted by sending a special SYN (synchronization) character.


The data portion of the frame is then contained between special sentinel characters: STX (start of text) and
ETX (end of text).
The SOH (start of header) field serves much the same purpose as the STX field. The frame format also
includes a field labeled CRC (cyclic redundancy check) that is used to detect transmission errors.
The problem with the sentinel approach is that the ETX character might appear in the data portion of the
frame.
BISYNC overcomes this problem by ―escaping the ETX character by preceding it with a DLE (data-
link-escape) character whenever it appears in the body of a frame; the DLE character is also escaped (by
preceding it with an extra DLE) in the frame body. This approach is called character stuffing.

(b) Point-to-Point Protocol (PPP) :

The more recent Point-to-Point Protocol (PPP). The format of PPP frame is

14
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

The Flag field has 01111110 as starting sequence.


The Address and Control fields usually contain default values.
The Protocol field is used for demultiplexing.
The frame payload size can he negotiated, but it is 1500 bytes by default.
The PPP frame format is unusual in that several of the field sizes are negotiated rather than fixed.
Negotiation is conducted by a protocol called LCP (Link Control Protocol).LCP sends control messages
encapsulated in PPP frame such messages are denoted by an LCP identifier in the PPP Protocol.

(c)Byte-Counting Approach: DDCMP (Digital Data Communication Message Protocol)


The number of bytes contained in a frame can he included as a field in the frame header. DDCMP
protocol is used for this approach. The frame format is

COUNT Field specifies how many bytes are contained in the frame’s body. Sometime count field will be
corrupted during transmission, so the receiver will accumulate as many bytes as the COUNT field
indicates. This is sometimes called a framing error. The receiver will then wait until it sees the next SYN
character.

2. Bit-Oriented Protocols (HDLC) In this, frames are viewed as collection of bits.

HDLC
High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to-point
and multipoint links. It implements the ARQ mechanisms .

HDLC is Characterized by

15
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

1. Stations
2. Configurations and
3. Transfer Modes
Stations Types
• Primary: Station which sends commands to the secondary station
• Secondary: Station which gives Response to that commands
• Combined: Can send both Command and Response.
Configurations Based on the Relationship of Hardware devices on a link
• Unbalanced: Master slave configuration, One in which one device is primary and others are secondary

• Symmetrical: Each physical station on a link consists of two Logical stations. One is primary and other is
secondary. Symmetrical behaves as unbalanced

• Balanced: Both stations are combined station. This will not support multi point

Transfer Modes
HDLC provides two common transfer modes that can be used in different configurations:
Normal response mode (NRM)
Asynchronous balanced mode (ABM).
Normal Response Mode:
In normal response mode (NRM), the station configuration is unbalanced. Have one primary station and
multiple secondary stations. A primary station can send commands; a secondary station can only respond. The
NRM is used for both point-to-point and multiple-point links.

16
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Asynchronous Balanced Mode


In asynchronous balanced mode (ABM), the configuration is balanced. The link is point-to-point, and each station
can function as a primary and a secondary .

Frames
HDLC defines three types of frames:
Information frames (I-frames),
Supervisory frames (S-frames),
Unnumbered frames (U-frames).
Each type of frame serves as an envelope for the transmission of a different type of message. I-frames are
used to transport user data and control information relating to user data (piggybacking). S-frames are used only to
transport control information. U-frames are reserved for system management. Information carried by U-frames is
intended for managing the link itself.
Frame Format
Each frame in HDLC may contain up to six fields. A beginning flag field, an address field, a control field,
an information field, a frame check sequence (FCS) field, and an ending flag field. In multiple-frame
transmissions the ending flag of one frame can serve as the beginning flag of the next frame.
HDLC frames

17
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Fields:
Flag field. The flag field of an HDLC frame is an 8-bit sequence with the bit pattern 01111110 that
identifies both the beginning and the end of a frame and serves as a synchronization pattern for the
receiver.
Address field. The second field of an HDLC frame contains the address of the secondary station. If a
primary station created the frame, it contains a to address. If a secondary creates the frame, it contains a
from address. An address field can be 1 byte or several bytes long, depending on the needs of the network.
One byte can identify up to 128 stations (l bit is used for another purpose). Larger networks require
multiple-byte address fields. If the address field is only 1 byte, the last bit is always a 1. If the address is
more than 1 byte, all bytes but the last one will end with 0; only the last will end with 1. Ending each
intermediate byte with 0 indicates to the receiver that there are more address bytes to come.
Control field. The control field is a 1- or 2-byte segment of the frame used for flow and error control. The
interpretation of bits in this field depends on the frame type.
FCS field. The frame check sequence (FCS) is the HDLC error detection field. It can contain either a 2-
or 4-byte ITU-T CRC.
Control Field:
The control field determines the type of frame and defines its functionality.

Control Field for I-Frames:

I-frames are designed to carry user data from the network layer. In addition, they can include flow and
error control information (piggybacking). The subfields in the control field are used to define these functions.
The first bit defines the type. If the first bit of the control field is 0, this means the frame is an I-frame. The
next 3 bits, called N(S), define the sequence number of the frame. The last 3 bits, called N(R), correspond to the
acknowledgment number when piggybacking is used.
The single bit between N(S) and N(R) is called the PIF bit. It means poll when the frame is sent by a
primary station to a secondary. It means final when the frame is sent by a secondary to a primary.
Control Field for S-Frames:

18
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Supervisory frames are used for flow and error control whenever piggybacking is either impossible or
inappropriate . S-frames do not have information fields.
If the first 2 bits of the control field is 10, this means the frame is an S-frame. The last 3 bits, called N(R),
corresponds to the acknowledgment number (ACK) or negative acknowledgment number (NAK) depending on
the type of S-frame.
The 2 bits called code is used to define the type of S-frame itself. With 2 bits, we can have four types of
S-frames,
Receive ready (RR). If the value of the code subfield is 00, it is an RR S-frame. This kind of frame
acknowledges the receipt of a safe and sound frame or group of frames. In this case, the value N(R) field
defines the acknowledgment number.
Receive not ready (RNR). If the value of the code subfield is 10, it is an RNR S-frame. This kind of
frame is an RR frame with additional functions. It acknowledges the receipt of a frame or group of
frames, and it announces that the receiver is busy and cannot receive more frames. It acts as a kind of
congestion control mechanism by asking the sender to slow down. The value of N(R) is the
acknowledgment number.
Reject (REJ). If the value of the code subfield is 01, it is a REJ S-frame. This is a NAK frame, but not
like the one used for Selective Repeat ARQ. It is a NAK that can be used in Go-Back-N ARQ to improve
the efficiency of the process by informing the sender, before the sender time expires, that the last frame is
lost or damaged. The value of N(R) is the negative acknowledgment number.
Selective reject (SREJ). If the value of the code subfield is 11, it is an SREJ S-frame. This is a NAK
frame used in Selective Repeat ARQ. Note that the HDLC Protocol uses the term selective reject instead
of selective repeat. The value of N(R) is the negative acknowledgment number.
Control Field for U-Frames:

Unnumbered frames are used to exchange session management and control information between
connected devices. Unlike S-frames, U-frames contain an information field, but one used for system management
information, not user data.
As with S-frames, however, much of the information carried by U-frames is contained in codes included
in the control field.
U-frame codes are divided into two sections: a 2-bit prefix before the P/F bit and a 3-bit suffix after the
P/F bit. Together, these two segments (5 bits) can be used to create up to 32 different types of U-frames.

19
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

3. Clock-Based Framing

(SONET) Synchronous Optical Network Standard is used for long distance transmission of data over
optical network. It supports multiplexing of several low speed links into one high speed links.
An STS-1 frame is used in this method.

It is arranged as nine rows of 90 bytes each, and the first 3 bytes of each row are overhead, with the rest
being available for data.
The first 2 bytes of the frame contain a special bit pattern, and it is these bytes that enable the receiver to
determine where the frame starts.
The receiver looks for the special bit pattern consistently, once in every 810 bytes, since each frame is 9 x
90 = 810 bytes long.

20
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

The STS-N frame can he thought of as consisting of N STS-1 frames, where the bytes from these frames
are interleaved; that is, a byte from the first frame is transmitted, then a byte from the second frame is
transmitted, and so on.
Payload from these STS-1 frames can he linked together to form a larger STS-N payload,¬ such a link is
denoted STS-Nc. One of the bit in overhead is used for this purpose.

Error Detection and Correction:


Data can be corrupted during transmission. For reliable communication, errors must be detected and
corrected.

Types of Errors :

1.Single-bit error

2. Burst Error

Single-bit error

The term Single-bit error means that only one bit of a given data unit (such as byte, character, data unit or
packet) is changed from 1 to 0 or from 0 to 1.

Burst Error

The term Burst Error means that two or more bits in the data unit have changed from 1 to 0 or from 0 to 1.

21
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Redundancy:

One method is to send every data twice, so that receiver checks every bit of two copies and detect error.

Drawbacks

Sends n-redundant bits for n-bit message.


Many errors are undetected if both the copies are corrupted.

Instead of adding entire data, some bits are appended to each unit. This is called redundant bit because
the bits added will not give any new information. These bits are called error detecting codes.

The three error detecting techniques are:


Parity check
Check sum algorithm
Cyclic Redundancy Check

Parity Check

Simple parity check :

Only one redundant bit, called parity bit is added to every data unit so that the total number of 1’s in unit become
even (or odd)

Two Dimensional Parity

It is based on simple parity. It performs calculation for each bit position across each byte in the frame. This adds
extra parity byte for entire frame, in addition to a parity bit for each byte.

For example frame containing 6 bytes of data. In this third bit of the parity byte is 1 since there are an odd
number of 1’s is in the third bit across the 6 bytes in the frame. In this case, 14 bits of redundant information are
added with original information.
22
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Check sum algorithm:

In the sender side all the words are added and then transmit the result of sum called checksum with the
data. The receiver performs the same calculation on the received data and compares the result with the
received checksum.
If any transmitted data, including the checksum itself, is corrupted, then the results will not match, so the
receiver knows that an error occurred. Instead of sending the checksum as such, one’s complement of
that sum will be send to the receiver.
If the receiver gets the result as zero then it will be the correct one. In this, we can represent unsigned
number from 0 to 2 using n bits.
If the number has more than n bits, the extra leftmost bits need to be added to the n rightmost bits. Data
can be divided in to 16 bit word and the Checksum is initialized to zero.

Cyclic Redundancy Check :


It uses small number of redundant bits to detect errors.
Divisor is calculated by the polynomial functions under two conditions.
a. It should not be divisible by x
b. It should be divisible by x+1
Consider the original message as M(x) – n+1 bits
Divisor C(x) – K bits
Original sent message = M(x) + k-1 bits

23
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Steps :

Append k-1 zeros with M(x) – P(x)


Divide P(x) by C(x)
Subtract the remainder from T(x)
Subtraction is made by making XOR operation

Eg: 100100 by 1101

24
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Error Correction:
Error Correction can be handled in two ways

1. When an error is discovered, the receiver can have the sender to retransmit the entire data unit.

2. A receiver can use an error correcting code, which automatically correct certain errors.

Error correcting codes are more sophisticated than error-detection codes and require more redundancy
bits.

In single bit error detection only two states are sufficient.

1) error

2) no error

Two states are not enough to detect an error but not to correct it.

Redundancy Bits :
To calculate the number of redundancy bit(r) required to correct a given number of data bits (m), we must
find a relationship between m and r.
Add m bits of data with r bits. The length of the resulting code is m+r.

Data and Redundancy bits

If the total number of bits are m+r, then r must be able to indicate at least m+r+1 different states. r bits can
indicate 2 different states. Therefore, 2 must be equal to or greater than m+r+1

2 ≥ + +1

25
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Hamming Code :
R.W. Hamming provides a practical solution for the error correction.

Positioning the Redundancy Bits


For example, a seven-bit ASCII code requires four redundancy bits that can be added to the end of the
data or intersperse with the original data bits. These redundancy bits are placed in positions 1, 2, 4 and 8. We refer
these bits as r1, r2, r3 and r4

26
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

The combination used to calculate each of the four r values for a seven-bit data sequence are as follows

The r1 bit is calculated using all bits positions whose binary representation include a 1 in the rightmost
position.
r2 is calculated using all bit position with a 1 in the second position and so on r1: bits 1,3,5,7,9,11
r2: bits 2, 3, 6, 7, 10, 11
r3: bits 4, 5, 6, 7
r4: bits 8, 9, 10, 11

27
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Calculating the r values


Place each bit of the original character in its appropriate position in the 11-bit unit.
Calculate the even parities for the various bit combination.
The parity value for each combination is the value of the corresponding r bit.

For example,
The value of r1 is calculated to provide even parity for a combination of bits 3,5,7,9 and 11.
The value of r2 is calculated to provide even parity with bits 3, 6, 7, 10 and 11.
The value of r3 is calculated to provide even parity with bits 4,5,6 and 7.
The value of r4 is calculated to provide even parity with bits 8,9,10 and 11.

Error Detection and Correction :


Now imagine the received data has 7th bit changed from 1 to 0.

Single-bit error

28
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

The receiver takes the transmission and recalculates four new data using the same set of bits used by the
sender plus the relevant parity (r) bit for each set.

Then it assembles the new parity values into a binary number in order of r position (r8,r4,r2,r1).
This step gives us the binary number 0111(7 in decimal) which is the precise location of the bit in error.
Once the bit is identified, the receiver can reverse its value and correct the error.

Hamming Distance:

One of the central concepts in coding for error control is the idea of the Hamming distance.

The Hamming distance between two words (of the same size) is the number of¬ differences
between the corresponding bits. The Hamming distance between two words x and y is d(x, y).
The Hamming distance can be found by applying the XOR operation on the two words and count
the number of 1’s in the result.
In a set of words, the minimum Hamming distance is the smallest Hamming distance¬ between all
possible pairs. We use dmin to define the minimum Hamming distance in a coding scheme.

Flow control:
Flow control is the management of data flow between computers or devices or between nodes in a
network so that the data can be handled at an efficient pace.
Too much data arriving before a device can handle it causes data overflow, meaning the data is either lost
or must be retransmitted.
29
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

For serial data transmission locally or in a network, the Xon/Xoff protocol can be used. For modem
connections, either Xon/Xoff or CTS/RTS (Clear to Send/Ready to Send) commands can be used to
control data flow.
Any time an error is detected in an exchange, specified frames are retransmitted. This process is called
automatic repeat request (ARQ).

PROTOCOLS:
The protocols are normally implemented in software by using one of the common programming
languages.

The data frames travel from one node, called the sender, to another node, called the receiver. Although
special frames, called acknowledgment (ACK) and negative acknowledgment (NAK) can flow in the
opposite direction for flow and error control purposes, data flow in only one direction.
In a real-life network, the data link protocols are implemented as bidirectional; data flow in both
directions.
In these protocols the flow and error control information such as ACKs and NAKs is included in the data
frames in a technique called piggybacking.

NOISELESS CHANNELS:
Let us first assume we have an ideal channel in which no frames are lost, duplicated, or corrupted. We
introduce two protocols for this type of channel. The first is a protocol that does not use flow control; the second
is the one that does.
Simplest Protocol:

30
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

The Simplest Protocol is one that has no flow control. It is a unidirectional protocol in which data frames
are traveling in only one direction-from the sender to receiver.

The data link layer at the sender site gets data from its network layer, makes a frame out of the data, and
sends it. The data link layer at the receiver site receives a frame from its physical layer, extracts data from
the frame, and delivers the data to its network layer.

The data link layers of the sender and receiver provide transmission services for their network layers. The
data link layers use the services provided by their physical layers for the physical transmission of bits.

The sender sends a sequence of frames without even thinking about the receiver. To send three frames,
three events occur at the sender site and three events at the receiver site.
Note that the data frames are shown by tilted boxes; the height of the box defines the transmission time
difference between the first bit and the last bit in the frame.

Stop-and-Wait Protocol:
The Stop-and-Wait Protocol sender sends one frame, stops until it receives confirmation from the receiver
(okay to go ahead), and then sends the next frame.
We still have unidirectional communication for data frames, but auxiliary ACK frames (simple tokens of
acknowledgment) travel from the other direction.

31
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

NOISY CHANNELS
Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor,
noiseless channels are nonexistent. We can ignore the error (as we sometimes do), or we need to add error
control to our protocols. We discuss three protocols in this section that use error control.
Stop-and-Wait Automatic Repeat Request
Go-Back-N Automatic Repeat Request
Selective Repeat Automatic Repeat Request

Stop-and-Wait Automatic Repeat Request Protocol:

This is the simplex protocol with sequence numbers and the ack frame indicating the sequence number of
the next frame expected.
In this sliding window protocol , the maximum window size of 1. Such a protocol uses stop-and wait
since the sender transmits a frame and waits for its acknowledgement before sending the next one.
The sending device keeps a copy of the last frame transmitted until it receives an acknowledgement.
If the acknowledgement frame gets lost and data link layer on A eventually times out.Not having received
an ACK, it assumes that its data frame was lost or damaged and sends the frame containing packet 1
again.

• Frames - alternately numbered as 0 and 1

• Ack for frame0 = ACK 1 and for frame1= ACK0

• Control Variables sender – S (no of recently sent frame)

receiver – R ( no of next frame expected

Operation:
The sender transmits the frame , when frame arrives at receiver it checks for damage
and acknowledges to the sender accordingly.While transmitting a frame there can be four
situations.
Normal Operation
Frame lost
Acknowledgement lost
Acknowledgement delayed

Normal operation

In normal operation the sender sends frame 0 and waits for acknowledgement ACK 1.After receiving
ACK 1, sender sends next frame 1 and waits for its acknowledgement ACK0 . This operation is repeated.
The sender will not send the next piece of data until it is sure that the current one is correctly received

32
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Stop-and-Wait ARQ, lost frame

When a receiver receives a data frame that is out of order, this means that frames were either lost or
duplicated.

• When sender does not receive its acknowledgement then the Corrupted and lost frames need to resent in
this protocol.

Stop-and-Wait ARQ, lost ACK frame

33
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

When an acknowledgement is lost , the sender does not know whether the frame is received by receiver.
After the timer expires , the sender re-transmits the same frame. On the other hand, receiver has already
received this frame earlier hence the second copy of the frame is discarded.

Stop-and-Wait ARQ, delayed ACK

The ACK frame may be delayed due to some link problem.The ACK is received after the timer is elapsed.
While the sender has already transmitted the same frame .
Again second ACK is initiated by receiver for the retransmitted frame, hence the second ACK is
discarded.
To avoid duplication the ACK must be numbered.

Bidirectional Transmission

34
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Each party should maintain S and R to track frames sent and expected.Piggybacking (hooking ack with
next outgoing data frame) can be used to save bandwidth

Drawbacks of stop and wait


• Only one frame can be in transit at a time

• after each frame sent the host must wait for an ACK.

• inefficient use of bandwidth

Sliding Window Protocols

• Sliding window
– Holds the unacknowledged outstanding frames in sender
– Holds the expected frames in receiver
• Sequence numbers
– sent frames are numbered sequentially
– if the number of bits in the header is m then sequence number goes from 0 to 2m - 1
• Protocols
– Go back – N
– Selective Repeat

Go Back - N
• Sender window size < 2m
• Receiver window size = 1
• Why the name go back- N?
– when the frame is damaged the sender goes back and sends a set of frames starting
from the last one ACKn’d
– the number of retransmitted frames is N
Example:
The window size is 4.
A sender has sent frame 6 and the timer expires for frame 3 (frame 3 not ACKn’d). The
sender goes back and re-sends the frames 3, 4, 5 and 6.

Control variables:
S- holds the sequence number of the recently sent frame

SF – holds sequence number of the first frame in the window

SL – holds the sequence number of the last frame

R – sequence number of the frame expected to be received

35
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Window size = − +1

Sender sliding window

Receiver sliding window

Go-Back-N ARQ, normal operation

36
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

The sender sends frames and update the control variables. , , and receiver updates the control
variable R.

Go-Back-N ARQ, lost frame

Suppose frame 2 is damaged or lost and of receiver frame 3, it will be discarded since it is expecting frame
2.Sender retransmits frame 2 and frame 3.

In Go-Back-N ARQ, the size of the sender window must be less than 2m; the size of the receiver window
is always 1.

Go-Back-N ARQ: sender window size

37
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Selective Repeat ARQ:


Processing at the receiver is more complex.
In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-half of 2m.
Both the transmitter and the receiver have the same window size
Receiver expects frames within the range of the sequence numbers

Selective Repeat ARQ - sender and receiver windows

Selective Repeat ARQ, lost frame:

In sequential transmission of frame 0,1,2,3 suppose frame 2 is lost and the next frame 3 is already received
sends NAK 2 frame to sender. The sender retransmits frame 2 only.

38
JEPPIAAR ENGINEERING COLLEGE CS6551-COMPUTER NETWORK

Selective Repeat ARQ, sender window size

39

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy