0% found this document useful (0 votes)
24 views62 pages

CN Unit 1

The document provides an overview of computer networks, detailing hardware, software, and various network models such as OSI and TCP/IP. It discusses the applications of computer networks in business, home, and mobile contexts, highlighting concepts like client-server models, peer-to-peer communication, and virtual private networks. Additionally, it addresses social issues related to networking, including network neutrality and digital copyright laws, while explaining different types of networks such as LAN, WAN, and MAN.

Uploaded by

Nihaal Varma
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)
24 views62 pages

CN Unit 1

The document provides an overview of computer networks, detailing hardware, software, and various network models such as OSI and TCP/IP. It discusses the applications of computer networks in business, home, and mobile contexts, highlighting concepts like client-server models, peer-to-peer communication, and virtual private networks. Additionally, it addresses social issues related to networking, including network neutrality and digital copyright laws, while explaining different types of networks such as LAN, WAN, and MAN.

Uploaded by

Nihaal Varma
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/ 62

COMPUTER NETWORKS

UNIT 1
Network hardware, Network software, OSI, TCP/IP Reference models, ExampleNetworks:
ARPANET, Internet.
Physical Layer: Guided Transmission media: twisted pairs, coaxial cable, fiberoptics,
Wireless transmission.
Data link layer: Design issues, framing, Error detection and correction.

COMPUTER NETWORKS & USES

COMPUTER NETWORK is the combination of the equipment (hardware & software) and
facilities that provide the basic communication service. The term ‘‘computer network’’ means
a collection of autonomous computers interconnected by a single technology. Two computers
are saidto be interconnected if they are able to exchange information. The connection need not
be via a copper wire; fiber optics, microwaves, infrared, and communication satellites can also
be used. Networks come in many sizes, shapes and forms. They are usually connected together
to make larger networks, with the Internet being the most well-known example of a network
of networks.
Internet architecture was defined by IETF(Internet Engineering Task Force) and first
computer network being introduced was ARPANET(Advanced Research Projects
Agency Network)

USES OF COMPUTER NETWORKS

1.1.1 Business Applications


Variety of business comprises different requirements of networking. A company may have a computer
for each worker and use them to design products, write brochures, and do the payroll. Initially, some of
these computers may have worked in isolation from the others, but at some point, management may
have decided to connect them to be able to distribute information throughout the company.

Resource sharing. The goal is to make all programs, equipment, and especiallydata available to
anyone on the network without regard to the physical locationof the resource or the user. An
obvious and widespread example is having a groupof office workers share a common printer.

1
COMPUTER NETWORKS UNIT 1

Sharing information: Networks called VPNs (Virtual Private Networks) may be used to join the
individual networks at different sites into one extended network. In other words, the mere fact that a user
happens to be 15,000 km away from his data should not prevent him from using the data as though they
were local.

Client Server Model : In this model, the data are stored on powerful computerscalled servers. Often
these are centrally housed and maintained by a system administrator. In contrast, the employees have
simpler machines, called clients,on their desks, with which they access remote data, for example, to
include in spreadsheets they are constructing.

Figure: Client Server Model

Communication takes the form of the client process sending a message over the network to the server
process. The client process then waits for a reply message. When the server process gets the request,
it performs the requested work or looks up the requested data andsends back a reply. These messages
are shown in Figure above.

1.1.2 Home Applications


Internet access provides home users with connectivity to remote computers. Muchof this information
is accessed using the client-server model, but there is different, popular model for accessing
information that goes by the name of peer- to-peer communication.
In this form, individuals who form a loose group can communicate with others in the group, as shown
in Figure below. Every person can, in principle, communicate with one or more other people; there is
no fixed division into clients and servers.
2
COMPUTER NETWORKS UNIT 1

Peer-to-peer communication is often used to share music and videos.

Between person-to-person communications and accessing information are social network applications.
Here, the flow of information is driven by the relationships thatpeople declare between each other.
A group of people can work together to create content. A wiki, for example, is a collaborative Web site that
the members of a community edit. The most famous wiki is the Wikipedia, an encyclopedia anyone can edit,
but there are thousandsof other wikis.
Our third category is electronic commerce. Home shopping is already popular and enables users to inspect
the online catalogs of thousands of companies. Someof these catalogs are interactive, showing products from
different viewpoints andin configurations that can be personalized.

1.1.3 Mobile Users


Mobile computers, such as laptop and handheld computers, are one of the fastest- growing segments
of the computer industry. Connectivity to the Internet enables many of these mobile uses. Since
having a wired connection is impossible in cars, boats, and airplanes, there is a lot of interest in wireless
networks. Cellular networksoperated by the telephone companies are one familiar kind of wireless
network thatblankets us with coverage for mobile phones.

Although wireless networking and mobile computing are often related, they are notidentical. In table
below we see a distinction between fixed wireless and mobile wireless networks. Even notebook
computers are sometimes wired. For example, ifa traveler plugs a notebook computer into the wired
network jack in a hotel room, he has mobility without a wireless network.

3
COMPUTER NETWORKS UNIT 1

Table: Combination of Wireless and Mobile Computing

1.1.4 Social Issues


Social networks, message boards, content sharing sites, and a host of other applications allow people
to share their views with like-minded individuals due to which some issues may arise as under:

Network Neutrality: The argument for communications to operators about not to differentiate by their
content or source or who is providing the content is known as network neutrality.
Reason: Some users of peer-to-peer applications had their network service cut off because the network
operators did not find it profitable to carry the large amounts of traffic sent by those applications.
Those same operators would probably like to treat different companies differently. If you are a big
company and pay well then you get good service, but if you are a small-time player, youget poor service.
Opponents of this practice argue that peer-to- peer and othercontent should be treated in the same way
because they are all just bits to thenetwork.
Digital Millennium Copyright Act: The DMCA was passed in 1998 as an anti-piracy statute
effectively making it illegal to overcome copy protections designed to prevent pirates from duplicating
digital copyrighted works and selling or freely distributing them.

Profiling Users: The practice or method of preparing a set of characteristics belonging to a certain
class or group of people or things by which to identify individuals as belonging to such a class or
group,as to detain forinvestigation of a possible crime.

Phishing: Phishing is a cyber attack that uses disguised email as a weapon. The goal is to trick the
email recipient into believing that the message is something they want or need-a request from their
bank, for instance, or a note from someone in their company and to click a link or download an
attachment.

4
COMPUTER NETWORKS UNIT 1

NETWORK HARDWARE

There are two types of transmission technology that are in widespread use: broadcast linksand point-
to-point links

(1) Point-to-point links:


connect individual pairs of machines. To go from the source to the destination on a network
made up of point-to-point links, short messages called packets in certain contexts, may have to
first visit one or moreintermediate machines.Point-to-point transmission with exactly one sender and
exactly one receiveris sometimes called unicasting.

(2) Broadcast network:


The communication channel is shared by all the machines on the network; packets sent by any
machine are received by all the others. An address field within each packet specifies the intended
recipient.Upon receiving a packet, a machine checks the address field. If the packet isintended or the
receiving machine, that machine processes the packet; if the packet is intended for some other
machine, it is just ignored.

Multiprocessor System Classified according to their range as


1. Personal Area Network
2. Local Area Network
3. Metropolitan Area Network
4. Wide Area Network
5. The Internet

(1) Personal Area Network:

PANs (Personal Area Networks) let devices communicate over the range of a person. A personal area
network (PAN) is a computer network organized around anindividual for personal use only. They typically
involve a computer, phone, printer,tablet, or some other device like a PDA.
We can use this network to transfer files, including email, calendar appointments, photos, and music. If we do
the transfers wirelessly, for example, using Wi-Fi or Bluetooth then it's technically called a WPAN, which is a
wireless personal area network.

In the simplest form, Bluetooth networks use the master-slave paradigm. The systemunit (the PC) is normally
the master, talking to the mouse, keyboard, etc., as slaves.The master tells the slaves what addresses to use,
when they can broadcast, how long they can transmit,what frequencies they can use and so on.

5
COMPUTER NETWORKS UNIT 1

(2) Local Area Network

A LAN is a pro owned network that operates within and nearby a singlebuildinglike a home, office
or factory.
LANs are widely used to connect personal computers and consumer electronicsto let them share
resources (e.g., printers) and exchange information.
When LANs are used by companies, they are called enterprise networks.LAN are categorized into:
Wired Lan (IEEE 802.3 Ethernet) and
Wireless Lan (IEEE 802.11) VLAN

Wireless and wired LANs. (a) 802.11. (b) Switched Ethernet.

6
COMPUTER NETWORKS UNIT 1

Sr. Key LAN WLAN


No.

Stands for LAN stands for Local Area WLAN stands for Wireless Local Area
1 Network. Network.

Connection LAN connections includes WLAN connections are completely


2 Type wired as well as wireless wireless technology based.
connection technologies.

Coverage LAN covers a large area like WLAN also covers a large regions like
3 building. building, office etc.

Cost LAN connections are less WLAN connections are more expensive
4 expensive, more secure that and considered less secure than wired
wireless connections of connections.
WLAN.

Complexity Installation of LAN is Installation of WLAN is costly but simple.


relatively cheaper but Routers, switches are not needed to
complex to install. It requires connect wires.
5
Routers, switches to connect
wires.

Performance LAN provides good WLAN provides high performance but


performance and impact of may get impacted in bad weather.
6
weather is limited.

Mobility LAN has limited mobility. WLAN is highly mobile in nature. No


LAN needs ethernet to ethernet is required to connect devices to
7
connect devices. WLAN.

Interruption LAN connections can not be WLAN connections can be interrupted


8 interrupted easily. easily.

7
COMPUTER NETWORKS UNIT 1

Sr. Key LAN WLAN


No.

Connection Wired LANs use a range of Wireless LAN uses a radio modem and an
different transmission antenna that is used to communicate with
technologies. Most of them other computers. In most cases, each
9 use copper wires, but some computer uses a device, called an AP
use optical fiber. (Access Point), wireless router, or base
station, relays packets between the wireless
computers and also between them and the
Internet.
Speed runs at speed of 100 Mbps to Runs at speed anywhere from 11 to
10 1 Gbps, hundreds of Mbps.

Examples Desktop, laptops connected Desktop, laptops connected on Wifi or


11 to LAN in an office. hotspot based networks.

Virtual LANs (VLAN):

Virtual LANs are a logical group of computers that appear to be on the same LAN irrespective
of the configuration of the underlying physical network.
Network administrators partition the networks to match the functional requirements of the
VLANs so that each VLAN comprise a subset of ports on a single or multipleswitches.
This allows computers and devices on a VLAN to communicate in the simulated environment
as if it is a separate LAN.

8
COMPUTER NETWORKS UNIT 1

VLANs make it easy for network administrators to partition a single switched network to
match the functional and security requirements of their systems withouthaving to run new
cables or make major changes in their current network infrastructure. VLANs are often set
up by larger businesses to re-partition devices for better traffic management.

(3) Metropolitan Area Network

A metropolitan area network (MAN) is a network with a size greater than LAN butsmaller
than a WAN. It normally comprises networked interconnections within a city that also offers
a connection to the Internet.

Figure: Architecture of MAN


The distinguishing features of MAN are

a. Network size generally ranges from 5 to 50 km. It may be as small as a groupof buildings in a
campus to as large as covering the whole city..
b. Data rates are moderate to high.
c. In general, a MAN is either owned by a user group or by a network providerwho sells service to
users, rather than a single organization as in LAN.
d. It facilitates sharing of regional resources.
e. They provide uplinks for connecting LANs to WANs and Internet.

9
COMPUTER NETWORKS UNIT 1

Example of MAN

Cable TV network: In this figure we see both television signals and Internet being fed into
the centralized cable headend for subsequent distribution to people’s homes.

(4)Wide Area Network

A wide area network (WAN) is a computer network that covers a large geographical area
comprising a region, a country, a continent or even the whole world. WAN includes the
technologies to transmit data, image, audio and video information over long distances and
among different LANs and MANs.
Typically, they have low data transfer rate and high propagation delay, i.e. they have low
communication speed. They generally have a higher bit error rate.

10
COMPUTER NETWORKS UNIT 1
WAN can be installed in three different types of connections:

(a) WAN 1: Connecting 3 Branch offices in one city

In WAN , the subnet consists of two distinct components: transmission lines and switching
elements. The job of the subnet is to carry messages from host to host.
Transmission lines move bits between machines. They can be made of copper wire, optical
fiber, or even radio links. Switching elements, or just switches, arespecialized computers that
connect two or more transmission lines. When data arrive on an incoming line, the switching
element must choose an outgoing lineon which to forward them.

(b) WAN 2: WAN using a virtual private network

A virtual private network (VPN) extends a private network across a public network and
enables users to send and receive data across shared or public networks as if their computing
devices were directly connected to the private network.
A VPN is created by establishing a virtual point-to-point connection through the use of
dedicated circuits or with tunneling protocols over existing networks. A VPN available from
the public Internet can provide some of the benefits of a wide area network (WAN). From a
user perspective, the resources available within the private network can be accessed remotely.

11
COMPUTER NETWORKS UNIT 1

(c) WAN 3: WAN using an ISP network.

The second variation is that the subnet may be run by a different company. The subnet operator is
known as a network service provider and the offices areits customers. The subnet operator will connect
to other customers too, as long as they can pay and it can provide service.
Since it would be a disappointing network service if the customers could onlysend packets to each
other, the subnet operator will also connect to other networks that are part of the Internet. Such a
subnet operator is called an ISP (Internet Service Provider) and the subnet is an ISP network. Its
customers who connect to the ISP receive Internet service.

NETWORK SOFTWARE

(1) Protocol Hierarchies

• A protocol is an agreement between the communicating peers on how communication is to


proceed.
• To reduce their design complexity, most networks are organized as a stack of layers or
levels, each one built upon the one below it.
• The number of layers, the name of each layer, the contents of each layer, and the function
of each layer differ from network to network.
• The purpose of each layer is to offer certain services to the higher layers while shielding
those layers from the details of how the offered services are actually implemented.

12
COMPUTER NETWORKS UNIT 1
Layers, Protocols and Interfaces

Peers:
The entities comprising the corresponding layers on different machines are called peers. The
peers may be software processes, hardware devices, or even human beings.Each layer passes
data and control information to the layer immediately belowit, until the lowest layer is reached.
Below layer 1 is the physical medium through which actual communication occurs.
Interface:
Between each pair of adjacent layers is an interface. The interface defines which primitive
operations and services the lower layer makes available to the upper one. In addition to
minimizing the amount of information that must be passed between layers, clear cut interfaces
also make it simpler to replace one layer with a completely different protocol or
implementation.

13
COMPUTER NETWORKS UNIT 1
Network Architecture:
A set of layers and protocols is called a network architecture. The specification of an
architecture must contain enough information to allow an implementer to write the program
or build the hardware for each layer so that itwill correctly obey the appropriate protocol.
Protocol Stack:
A list of the protocols used by a certain system, one protocol per layer, is called a protocol
stack. When layer n on one machine carries on a conversationwith layer n on another machine,
the rules and conventions used in this conversation are collectively known as the layer n
protocol.

(2) Layering Principle


Layering Principle shows how communication is provided to the top layer of thefive-layer
network is shown in Figure below.

14
COMPUTER NETWORKS UNIT 1

A message, M, is produced by an application process running in layer 5 and given


to layer 4 for transmission.

Layer 4 puts a header in front of the message to identify the message and passes
the result to layer 3. The header includes control information, such as addresses, to
allow layer 4 on the destination machine to deliver the message.

In many networks, no limit is placed on the size of messages transmitted in the


layer 4 protocol but there is nearly always a limit imposed by the layer 3 protocol.

Consequently, layer 3 must break up the incoming messages into smaller units,
packets, prepending a layer 3 header to each packet. In this example, M is

Layer 3 decides which of the outgoing lines to use and passes the packets to

Layer 2 adds to each piece not only a header but also a trailer, and gives
the resulting unit to layer 1 for physical transmission

At the receiving machine the message moves upward, from layer to layer, with
headers being stripped off as it progresses. None of the headers for layers below n are
passed up to layer n.

15
COMPUTER NETWORKS UNIT 1

Figure : Layering principle

Design Issues for the Layers

Reliability is the design issue of making a network that operates correctly even though it is
made up of a collection of components that are themselves unreliable.

(1) Error detection and Correction:


One mechanism for finding errors in received information uses codes for error detection.
Information that is incorrectly received can then be retransmitted until itis received correctly.
More powerful codes allow for error correction, where the correct message is recovered from
the possibly incorrect bits that were originally received.

(2)Finding a working path on network:


Since there are multiple paths between a source and destination, and in a large network, there
may be some links or routers that are broken. The networkshould automatically make this
decision to find a correct working path and this mechanismis called routing.

16
COMPUTER NETWORKS UNIT 1

(3) Addressing or Naming:


Since there are many computers on the network, every layer needs a mechanism foridentifying
the senders and receivers that are involved in a particular message. This mechanism is
called addressing or naming, in the low and high layers, respectively.

(4)Scalability:
Designs that continue to work well when the network gets large are said to be scalable. And
In real time, networks always grow hence, it should be able to accommodate all changes.

(5)Resource Allocation:
(a) Flow Control:
Flow control is a technique that allows two stations working at different speeds to
communicate with each other. In data link layer, flow control restricts the number of frames
the sender can send before it waits for an acknowledgment from the receiver.
(b) Congestion
Congestion is the reduced quality of service that occurs when anetwork node or link is
carrying more data than it can handle.
(c)Quality of Service
Quality-of-Service (QoS) refers to traffic control mechanisms that seek to either differentiate
performance based on application or network-operator requirements or provide predictable
or guaranteed performance to applications, sessions or traffic aggregates.

(6)Security:
The major design issue is to secure the network by defending it against different kinds of
threats.

(a) Confidentiality
Confidentiality means that only the authorized individuals/systems can view sensitive or
classified information. The data being sent over the network should not be accessed by
unauthorized individuals.
(b) Integrity
Data integrity, in the context of networking, refers to the overall completeness, accuracy and
consistency of data. Data integrity must be imposed when sending data through a network.
This can be achieved by using error checking and correction protocols.
(c)Authentication
Authentication is the process of recognizing a user's identity. The credentials provided are
compared to those on a file in a database of the authorized user's information on a local
operating system or within an authentication server.
17
COMPUTER NETWORKS UNIT 1

Connection-Oriented Versus Connectionless Service

Connection oriented and Connectionless services are the two data transmission services
provided by the network layer protocols and transport layer protocols.

The Connection oriented services establish a connection prior to sending the packets
belonging to the same message from source to the destination.On the other hand, the
connectionless service considers each packet belongingto the same message as a different &
independent entity and route them with adifferent path.

Connection-Oriented Service
The connection oriented service first establishes the virtual connection between the source
and the destination, then transfers all data packets belonging to the samemessage through
same dedicated established connection and after all packets of a message is transferred it
releases the connection.

To establish a connection a source sends a request packet to the destination. In response to


which destination sends the acknowledgement packet to the source confirming that the
destination is ready to accept the data from the source.

18
COMPUTER NETWORKS UNIT 1

Connectionless Service
Connectionless service is a method of data transmission between two computers ina different
network. Connectionless service is also termed as datagram service. Thisservice look-alike
the postal system where each letter carries its source & destination address and each one of
them is routed through a different path.

The source divides the message into small acceptable packets these packets known as a
datagram. These datagrams are individually pushed into the network; each datagram may
travel a different path. The network considers each datagram or data packet as an
independent entity i.e. no relationship is considered between the packets belonging to the
same message.

Each datagram carries its source and destination address. The router uses the destination
address to route the datagram to its destination. The packets received atthe destination may be
received out of order. Hence, the datagrams are assembledto recreate the original message.

19
COMPUTER NETWORKS UNIT 1

Service Primitives

A service is formally specified by a set of primitives (operations) available to userprocesses


to access the service. These primitives tell the service to perform some action or report on an
action taken by a peer entity.

20
COMPUTER NETWORKS UNIT 1

Protocol implementation Services

1. First, the server executes LISTEN to indicate that it is prepared to accept incoming
connections. A common way to implement LISTEN is to make it a blocking system call. After
executing the primitive, the server process is blockeduntil a request for connection appears.

2. Next, the client process executes CONNECT to establish a connection with the server. The
CONNECT call needs to specify who to connect to, so it might havea parameter giving the
server’s address.

3. The client process is suspended until there is a response.

4.When the packet arrives at the server, the operating system sees that the packet isrequesting a
connection. It checks to see if there is a listener, and if so it unblocks the listener.

5. The server process can then establish the connection with the ACCEPT call. Thissends a
response back to the client process to accept the connection. The arrivalof this response then
releases the client. At this point the client and server are both running and they have a
connection established.

Service and Protocol

• A service is a set of primitives (operations) that a layer provides to the layer


above it. The service defines what operations the layer is prepared to perform onbehalf of its
users, but it says nothing at all about how these operations are implemented.

21
COMPUTER NETWORKS UNIT 1

• A service relates to an interface between two layers, with the lower layer
being the service provider and the upper layer being the service user.
• A protocol, in contrast, is a set of rules governing the format and meaning of
thepackets, or messages that are exchanged by the peer entities within a layer. Entities use
protocols to implement their service definitions.

Figure : Relation between a Service and a protocol

22
COMPUTER NETWORKS UNIT 1

REFERENCE MODELS
The OSI Model is just a reference/logical model. It was designed to describe the
functionsof the communication system by dividing the communication procedure into
smaller and simpler components.
But the TCP/IP model was designed and developed by Department of Defense (DoD)
in 1960s and is based on standard protocols. It stands for Transmission Control
Protocol/Internet Protocol. The TCP/IP model is a concise version of the OSI model.

OSI MODEL
• OSI stands for Open Systems Interconnection. It has been developed by ISO
– ‘International Organization of Standardization‘, in the year 1984. This
model comprises of 7 layers which have their own functions, protocols and
services.

Principles applied at each layer:


The principles that were applied to arrive at the seven layers can be
brieflysummarized as follows:
1. A layer should be created where a different abstraction is needed.
2. Each layer should perform a well-defined function.
3. The function of each layer should be chosen with an eye toward
defininginternationally standardized protocols.
4. The layer boundaries should be chosen to minimize the information flow
acrossthe interfaces.
5. The number of layers should be large enough that distinct functions need not
be thrown together in the same layer out of necessity and small enough that the
architecture does not become unwieldy.

23
COMPUTER NETWORKS UNIT 1

1. Physical Layer (Layer 1) :

• The lowest layer of the OSI reference model is the physical layer. It is
responsible for the actual physical connection between the devices. The
physicallayer contains information in the form of bits.
• It is responsible for transmitting individual bits from one node to the next.
Whenreceiving data, this layer will get the signal received and convert it into
0s and 1s and send them to the Data Link layer, which will put the frame back
together.
24
COMPUTER NETWORKS UNIT 1

• The functions of the physical layer are :

1. Bit synchronization: The physical layer provides the synchronization of


thebits by providing a clock. This clock controls both sender and receiver
thus providing synchronization at bit level.

2. Bit rate control: The Physical layer also defines the transmission rate i.e.
the number of bits sent per second.

3. Transmission mode: Physical layer also defines the way in which the data
flows between the two connected devices. The various transmission modes
possible are: guided or unguided transmission media.

2. Data Link Layer (DLL) (Layer 2) :

• The data link layer is responsible for the node to node delivery of the
message. The main function of this layer is to make sure data transfer is error-
free from one node to another, over the physical layer.
• When a packet arrives in a network, it is the responsibility of DLL to transmit
itto the Host using its MAC address.
• Data Link Layer is divided into two sub layers :
1. Logical Link Control (LLC)
2. Media Access Control (MAC)

• The functions of the data Link layer are :

1. Framing: Framing is a function of the data link layer. It provides a way for
a sender to transmit a set of bits that are meaningful to the receiver. This can
be accomplished by attaching special bit patterns to the beginning and end of
the frame.

2. Physical addressing: After creating frames, Data link layer adds physical
addresses (MAC address) of sender and/or receiver in the header of each
frame.

3. Error control: Data link layer provides the mechanism of error control in
whichit detects and retransmits damaged or lost frames.
25
COMPUTER NETWORKS UNIT 1

4. Flow Control: The data rate must be constant on both sides else the data may
get corrupted thus , flow control coordinates that amount of data that can be
sentbefore receiving acknowledgement.

5. Access control (MAC): When a single communication channel is shared by


multiple devices, MAC sub-layer of data link layer helps to determine which
device has control over the channel at a given time.

• Packet in Data Link layer is referred as Frame.Switch & Bridge are Data Link
Layer devices.

3. Network Layer (Layer 3) :

• Network layer works for the transmission of data from one host to the other
located in different networks. It also takes care of packet routing i.e. selection
ofthe shortest path to transmit the packet, from the number of routes available.
• The sender & receiver’s IP address are placed in the header by the network layer.

• The functions of the Network layer are :

1. Routing: The network layer protocols determine which route is suitable


fromsource to destination. This function of network layer is known as
routing.

2. Logical Addressing: In order to identify each device on internetwork


uniquely, network layer defines an addressing scheme. The sender &
receiver’s IP address are placed in the header by network layer. Such an
address distinguishes each device uniquely and universally.

• Segment in Network layer is referred as Packet. Network layer is


implementedby networking devices such as routers.

4. Transport Layer (Layer 4) :

• Transport layer provides services to application layer and takes services from
network layer. The data in the transport layer is referred to as Segments.
26
COMPUTER NETWORKS UNIT 1
• It is responsible for the End to End Delivery of the complete message. The
transport layer also provides the acknowledgement of the successful data
transmission and re-transmits the data if an error is found.

• The functions of the transport layer are :

1. Segmentation and Reassembly: This layer accepts the message from the
(session) layer , breaks the message into smaller units . Each of the
segmentproduced has a header associated with it. The transport layer at
the destination station reassembles the message.

2. Port Addressing: In order to deliver the message to correct process,


transport layer header includes a type of address called service point
address or port address. Thus by specifying this address, transport layer
makes sure that the message is delivered to the correct process.

• Data in the Transport Layer is called as Segments.

5. Session Layer (Layer 5) :

• This layer is responsible for establishment of connection, maintenance of


sessions, authentication and also ensures security.

• The functions of the session layer are :

1. Session establishment, maintenance and termination: The layer


allows the two processes to establish, use and terminate a connection.

2. Synchronization : This layer allows a process to add checkpoints which


are considered as synchronization points into the data. These
synchronization point help to identify the error so that the data is re-
synchronized properly, and ends of the messages are not cut prematurely
and data loss is avoided.

3. Dialog Controller : The session layer allows two systems to start


communication with each other in half-duplex or full-duplex.

27
COMPUTER NETWORKS UNIT 1
6. Presentation Layer (Layer 6) :

• Presentation layer is also called the Translation layer. The data from the
application layer is extracted here and manipulated as per the required format
totransmit over the network.
• The functions of the presentation layer are :

1. Translation : For example, ASCII to EBCDIC.

2. Encryption/ Decryption : Data encryption translates the data into


another form or code. The encrypted data is known as the cipher text
andthe decrypted data is known as plain text. A key value is used for
encrypting as well as decrypting data.

3. Compression: Reduces the number of bits that need to be transmitted


onthe network.

7. Application Layer (Layer 7) :

• At the very top of the OSI Reference Model stack of layers, we find
Applicationlayer which is implemented by the network applications.
• These applications produce the data, which has to be transferred over
thenetwork. This layer also serves as a window for the application services to
accessthe network and for displaying the received information to the user.
Ex: Application – Browsers, Skype Messenger etc.
• Application Layer is also called as Desktop Layer.

28
COMPUTER NETWORKS UNIT 1

TCP/IP MODEL

Need:
• The ability to connect multiple networks in a seamless way was one of the
majordesign goals.
• Since applications with divergent requirements can be needed in future,
ranging from transferring files to real-time speech transmission, a flexible
architecture was needed, so TCP/IP was introduced.

29
1. The Link Layer

• The lowest layer in the model, the link layer describes what links such as serial
lines and classic Ethernet must do to meet the needs of this connectionless
internet layer.
• It is not really a layer at all, in the normal sense of the term, but ratheran
interface between hosts and transmission links.

2. The Internet Layer

• Packet Routing: Its job is to permit hosts to inject packets into any network
and have them travel independently to the destination (potentially on a
different network). They may even arrive in acompletely different order than
they were sent, in which case it is the job of higher layers to rearrange them,
if in-order delivery is desired.

• The internet layer defines an official packet format and protocol called IP
(Internet Protocol), plus a companion protocol called ICMP (Internet
Control Message Protocol) that helps it function.
• The job of the internet layer is to deliver IP packets where they are supposed
to go.

3. The Transport Layer

• It is designed to allow peer entities on the source and destinationhosts


to carry on a conversation.
• Two end-to-end transport protocols are:

1. The first one, TCP (Transmission Control Protocol), is a reliable connection-


oriented protocol that allows a byte stream originatingon one machine to be
delivered without error on any other machinein the internet.

2. It segments the incoming byte stream into discrete messages and passes each
one on to the internet layer.

3. At the destination, the receiving TCP process reassembles the received


messages into the output stream.

4. TCP also handles flow control to make sure a fast sender cannot swamp a
slow receiver with more messages than it can handle.
5. The second protocol in this layer, UDP (User DatagramProtocol),
is an unreliable, connectionless protocol for applications that do not
want TCP’s sequencing or flow control and wish to provide their
own.

6. It is also widely used for one-shot, client-server-type request- reply


queries and applications in which prompt delivery is moreimportant than
accurate delivery, such as transmitting speech or video.

4. The Application Layer


• It contains all the higher- level protocols.
• The early ones included virtual terminal (TELNET), file transfer (FTP), and
electronic mail (SMTP), Domain Name System (DNS), for mapping host
names onto their network addresses, HTTP, the protocol for fetching pages
on the World Wide Web, and RTP, the protocol for delivering real-time
media such as voice or movies.

TCP/IP PROTOCOLS MODELS


COMPUTER NETWORKS UNIT 1

Comparison of TCP and OSI layers

TCP/IP OSI

TCP refers to Transmission Control OSI refers to Open Systems


Protocol. Interconnection.

TCP/IP has 5 layers. OSI has 7 layers.

TCP/IP is more reliable OSI is less reliable

TCP/IP does not have very strict


boundaries.
OSI has strict boundaries

TCP/IP follow a horizontal approach. OSI follows a vertical approach.

TCP/IP uses both session and presentation OSI uses different session and presentation
layer in the application layer itself. layers.

TCP/IP developed protocols then model. OSI developed model then protocol.

Transport layer in TCP/IP does not In OSI model, transport layer provides
provide assurance delivery of packets. assurance delivery of packets.

TCP/IP model network layer only Connection less and connection oriented
provides connection less services. both services are provided by network
layer in OSI model.
NETWORK MODELS (ARPANET AND INTERNET)

The ARPANET
The story begins in the late 1950s. At the height of the Cold War, the U.S. DoD wanted a command-and-
control network that could survive a nuclear war. At that time, all military communications used the public
telephone network, which was considered vulnerable. The reason for this belief can be gleaned from Fig. 1-
25(a). Here the black dots represent telephone switching offices, each of which was connected to thousands
of telephones. These switching offices were, in turn, connected to higher-level switching offices (toll
offices), to form a national hierarchy with only a small amount of redundancy. The vulnerability of the
system was that the destruction of a few key toll offices could fragment it into many isolated islands.

Figure 1-25. (a) Structure of the telephone system. (b) Baran’s proposed distributed switching system.
Around 1960, the DoD awarded a contract to the RAND Corporation to find a solution. One of its
employees, Paul Baran, came up with the highly distributed and fault-tolerant design of Fig. 1-25(b). Since
the paths between any two switching offices were now much longer than analog signals could travel without
distortion, Baran proposed using digital packet-switching technology. Baran wrote several reports for the
DoD describing his ideas in detail (Baran, 1964). Officials at the Pentagon liked the concept and asked
AT&T, then the U.S.’ national telephone monopoly, to build a prototype. AT&T dismissed Baran’s ideas out
of hand. The biggest and richest corporation in the world was not about to allow some young
whippersnapper tell it how to build a telephone system. They said Baran’s network could not be built and the
idea was killed.
Several years went by and still the DoD did not have a better command-and control system. To understand
what happened next, we have to go back all the way to October 1957, when the Soviet Union beat the U.S.
into space with the launch of the first artificial satellite, Sputnik. When President Eisenhower tried to find
out who was asleep at the switch, he was appalled to find the Army, Navy,and Air Force squabbling over the
Pentagon’s research budget. His immediate response was to create a single defense research organization,
ARPA, the Advanced Research Projects Agency. ARPA had no scientists or laboratories;in fact, it had
nothing more than an office and a small (by Pentagon standards) budget. It did its work by issuing grants and
contracts to universities and companies whose ideas looked promising to it.

For the first few years, ARPA tried to figure out what its mission should be.In 1967, the attention
of Larry Roberts, a program manager at ARPA who was trying to figure out how to provide remote access to
computers, turned to networking.

He contacted various experts to decide what to do. One of them, Wesley Clark, suggested building a packet-
switched subnet, connecting each host to its own router.After some initial skepticism, Roberts bought the
idea and presented a somewhat vague paper about it at the ACM SIGOPS Symposium on Operating System
Principles held in Gatlinburg, Tennessee in late 1967 (Roberts, 1967). Much to Roberts’ surprise, another
paper at the conference described a similar system that had not only been designed but actually fully
implemented under the direction of Donald Davies at the National Physical Laboratory in England.
The NPL system was not a national system (it just connected several computers on the NPL campus), but it
demonstrated that packet switching could be made to work. Furthermore,it cited Baran’s now discarded
earlier work. Roberts came away from Gatlinburg determined to build what later became known as the
ARPANET.
The subnet would consist of minicomputers called IMPs (Interface Message Processors) connected by 56-
kbps transmission lines. For high reliability, each IMP would be connected to at least two other IMPs. The
subnet was to be a datagram subnet, so if some lines and IMPs were destroyed, messages could be
automatically rerouted along alternative paths.
Each node of the network was to consist of an IMP and a host, in the same room, connected by a short wire.
A host could send messages of up to 8063 bits to its IMP, which would then break these up into packets of at
most 1008 bits and forward them independently toward the destination. Each packet was received in its
entirety before being forwarded, so the subnet was the first electronic store and-forward packet-switching
network.
ARPA then put out a tender for building the subnet. Twelve companies bid for it. After evaluating all the
proposals, ARPA selected BBN, a consulting firm based in Cambridge, Massachusetts, and in December
1968 awarded it a contract to build the subnet and write the subnet software. BBN chose to use specially
modified Honeywell DDP-316 minicomputers with 12K 16-bit words of core memory as the IMPs. The
IMPs did not have disks, since moving parts were considered unreliable. The IMPs were interconnected by
56-kbps lines leased from telephone companies. Although 56 kbps is now the choice of teenagers who
cannot afford DSL or cable, it was then the best money could buy.
The software was split into two parts: subnet and host. The subnet software consisted of the IMP end of the
host-IMP connection, the IMP-IMP protocol, and a source IMP to destination IMP protocol designed to
improve reliability. The original ARPANET design is shown in Fig. 1-26.
Figure 1-26. The original ARPANET design.
Outside the subnet, software was also needed, namely, the host end of the host-IMP connection, the host-
host protocol, and the application software. It soon became clear that BBN was of the opinion that when it
had accepted a message on a host-IMP wire and placed it on the host-IMP wire at the destination, its job was
done.
Roberts had a problem, though: the hosts needed software too. To deal with it, he convened a meeting of
network researchers, mostly graduate students, at Snowbird, Utah, in the summer of 1969. The graduate
students expected some network expert to explain the grand design of the network and its software to them
and then assign each of them the job of writing part of it. They were astounded when there was no network
expert and no grand design. They had to figure out what to do on their own.Nevertheless, somehow an
experimental network went online in December1969 with four nodes: at UCLA, UCSB, SRI, and the
University of Utah. These four were chosen because all had a large number of ARPA contracts, and all had
different and completely incompatible host computers (just to make it more fun).
The first host-to-host message had been sent two months earlier from the UCLA node by a team led by Len
Kleinrock (a pioneer of the theory of packet switching) to the SRI node. The network grew quickly as more
IMPs were delivered and installed; it soon spanned the United States. Figure 1-27 shows how rapidly the

Figure 1-27. Growth of the ARPANET. (a) December 1969. (b) July 1970.
(c) March 1971. (d) April 1972. (e) September 1972.
In addition to helping the fledgling ARPANET grow, ARPA also funded research on the use of satellite
networks and mobile packet radio networks. In one now famous demonstration, a truck driving around in
California used the packet radio network to send messages to SRI, which were then forwarded over the
ARPANET to the East Coast, where they were shipped to University College in London over the satellite
network. This allowed a researcher in the truck to use a computer in London while driving around in
California.
This experiment also demonstrated that the existing ARPANET protocols were not suitable for running over
different networks. This observation led to more research on protocols, culminating with the invention of the
TCP/IP model and protocols (Cerf and Kahn, 1974). TCP/IP was specifically designed to handle
communication over internetworks, something becoming increasingly important as more and more networks
were hooked up to the ARPANET.
To encourage adoption of these new protocols, ARPA awarded several contracts to implement TCP/IP on
different computer platforms, including IBM,DEC, and HP systems, as well as for Berkeley UNIX.
Researchers at the University of California at Berkeley rewrote TCP/IP with a new programming interface
called sockets for the upcoming 4.2BSD release of Berkeley UNIX. They also wrote many application,
utility, and management programs to show how convenient it was to use the network with sockets.
The timing was perfect. Many universities had just acquired a second or third VAX computer and a LAN to
connect them, but they had no networking software. When 4.2BSD came along, with TCP/IP, sockets, and
many network utilities, the complete package was adopted immediately. Furthermore, with TCP/IP, it was
easy for the LANs to connect to the ARPANET, and many did.
During the 1980s, additional networks, especially LANs, were connected to the ARPANET. As the scale
increased, finding hosts became increasingly expensive, so DNS (Domain Name System) was created to
organize machines into domains and map host names onto IP addresses. Since then, DNS has become a
generalized, distributed database system for storing a variety of information related to naming.

The Internet
The Internet is not really a network at all, but a vast collection of different networks that use certain common
protocols and provide certain common services.It is an unusual system in that it was not planned by anyone
and is not controlled by anyone. To better understand it, let us start from the beginning and see how it has
developed and why.

Architecture of the Internet


The big picture is shown in Fig. 1-29. Let us examine this figure piece by piece, starting with a computer at
home (at the edges of the figure). To join the Internet, the computer is connected to an Internet Service
Provider, or simply ISP, from who the user purchases Internet access or connectivity. This lets the
computer exchange packets with all of the other accessible hosts on the Internet. The user might send
packets to surf the Web or for any of a thousand other uses, it does not matter. There are many kinds of
Internet access, and they are usually distinguished by how much bandwidth they provide and how much they
cost, but the most important attribute is connectivity

A common way to connect to an ISP is to use the


(1)Phone line to your house, in which case your phone company is your ISP.
(a) DSL, short for Digital Subscriber Line, reuses the telephone line that connects to your house for
digital data transmission. The computer is connected to a device called a DSL modem that converts between
digital packets and analog signals that can pass unhindered over the telephone line. At the other end, a device
called a DSLAM (Digital Subscriber Line Access Multiplexer) converts between signals and packets.
(b) DSL is a another type of higher-bandwidth uses the local telephone line than to send bits over a
traditional telephone call instead of a voice conversation. That is called dial-up and done with a different
kind of modem at both ends. The word modem is short for ‘‘modulator demodulator’’ and refers to any
device that converts between digital bits and analog signals.
(c) Another method is to send signals over the cable TV system. Like DSL, this is a way to reuse existing
infrastructure, in this case otherwise unused cable TV channels. The device at the home end is called a cable
modem and the device at the cable headend is called the CMTS (Cable Modem Termination System).
DSL and cable provide Internet access at rates from a small fraction of a megabit/sec to multiple
megabit/sec, depending on the system. These rates are much greater than dial-up rates, which are limited to
56 kbps because of the narrow bandwidth used for voice calls.
(2) Fiber lines: Internet access at much greater than dial-up speeds is called broadband. The name refers to
the broader bandwidth that is used for faster networks, rather than any particular speed. The access methods
mentioned so far are limited by the bandwidth of the ‘‘last mile’’ or last leg of transmission. By running
optical fiber to residences, faster Internet access can be provided at rates on the order of 10 to 100 Mbps.
This design is called FTTH (Fiber to the Home). For businesses in commercial areas, it may make sense to
lease a high-speed transmission line from the offices to the nearest ISP.
ISP networks may be regional, national, or international in scope. We have already seen that their
architecture is made up of long-distance transmission lines that interconnect routers at POPs in the different
cities that the ISPs serve. This equipment is called the backbone of the ISP. If a packet is destined for a host
served directly by the ISP, that packet is routed over the backbone and delivered to the host. Otherwise, it
must be handed over to another ISP.
ISPs connect their networks to exchange traffic at IXPs (Internet eXchange Points). The connected ISPs
are said to peer with each other. There are many IXPs in cities around the world. They are drawn vertically
in Fig. 1-29 because ISP networks overlap geographically. Basically, an IXP is a room full of routers, at
least one per ISP. A LAN in the room connects all the routers, so packets can be forwarded from any ISP
backbone to any other ISP backbone. IXPs can be large and independently owned facilities. One of the
largest is the Amsterdam Internet Exchange, to which hundreds of ISPs connect and through which they
exchange hundreds of gigabits/sec of traffic.
At the top of the food chain are a small handful of companies, like AT&T and Sprint, that operate large
international backbone networks with thousands of routers connected by high-bandwidth fiber optic links.
These ISPs do not pay for transit. They are usually called tier 1 ISPs and are said to form the backbone of
the Internet, since everyone else must connect to them to be able to reach the entire Internet. Companies that
provide lots of content, such as Google and Yahoo!, locate their computers in data centers that are well
connected to the rest of the Internet.
These data centers are designed for computers, not humans, and may be filled with rack upon rack of
machines called a server farm. Colocation or hosting data centers let customers put equipment such as
servers at ISP POPs so that short, fast connections can be made between the servers and the ISP backbones.
Physical Layer

GUIDED TRANSMISSION MEDIA


The purpose of the physical layer is to transport bits from one machine to another. Various physical media can
beused for the actual transmission.

Each one has its own niche in terms of


• bandwidth,
• delay,
• cost,
• ease of installation and
• maintenance.

Media are grouped into


• guided media(copper wire and fiber optics)
• unguided media(terrestrial wireless, satellite, and lasers through the air).

Twisted Pairs
• Although the bandwidth characteristics of magnetic tape are excellent, the delaycharacteristics are
poor.Transmission time is measured in minutes or hours,not milliseconds.
• One of the oldest and still most common transmission media is twisted pair.
• A twisted pair consists of two insulated copper wires, typically about 1 mm thick.
• The wires are twisted together in a helical form, just like a DNA molecule.
• Twisting is done because two parallel wires constitute a fine antenna.
• When the wires are twisted, the waves from different twists cancel out, so the wire radiates less
effectively.
• A signal is usually carried as the difference in voltage between the two wires in the pair.
• This provides better immunity to external noise because the noise tends to affect both wires the
same,leaving the differential unchanged.
• The most common application of the twisted pair is the telephone system.
• Twisted pairs can run several kilometers without amplification, but for longer distances the signal
becomestoo attenuated and repeaters are needed.
• When many twisted pairs run in parallel for a substantial distance, such as all the wires coming from
an apartment building to the telephone company office, they are bundled together and encased in a
protectivesheath.
• Twisted pairs can be used for transmitting either analog or digital information.The bandwidth
depends onthe thickness of the wire and the distance traveled, but several megabits/sec can be
achieved for a few kilometers in many cases.
• Due to their adequate performance and low cost, twisted pairs are widely used.
• Twisted-pair cabling comes in several varieties.
• The garden variety deployed in many office buildings is called Category 5 cabling, or ‘‘Cat 5.’’
• A category 5 twisted pair consists of two insulated wires gently twisted together. Four such pairs
are typically grouped in a plastic sheath to protect the wires and keep them together. This
arrangement isshown in Fig.

• Different LAN standards may use the twisted pairs differently.


• For example,100-Mbps Ethernet uses two (out of the four) pairs, one pair for each direction.
• Cat 5 replaced earlier Category 3 cables with a similar cable that uses the same connector, but has
more twists per meter. More twists result in less crosstalk and a better-quality signal over longer
distances, making the cables more suitable for high-speed computer communication, especially 100-
Mbps and 1-GbpsEthernet LANs.
• New wiring is more likely to be Category 6 or even Category 7.
• These categories has more stringent specifications to handle signals with greater bandwidths.
• Some cables in Category 6 and above are rated for signals of 500 MHz and can support the 10-Gbps
linksthat will soon be deployed. Through Category 6, these wiring types are referred to as UTP
(Unshielded Twisted Pair) as they consist simply of wires and insulators.
• In contrast to these, Category 7 cables have shielding on the individual twisted pairs, as well as around
theentire cable (but inside the plastic protective sheath). Shielding reduces the susceptibility to
external interference and crosstalk with other nearby cables to meet demanding performance
specifications.

Coaxial Cable:
• Another common transmission medium is the coaxial cable (‘‘coax’’ ’).
• It has better shielding and greater bandwidth than unshielded twisted pairs
• It can span longer distances at higher speeds.
• Two kinds of coaxial cable are widely used.
• One kind, 50-ohm cable, is commonly used when it is intended for digital transmission from the start.
• The other kind, 75-ohm cable, is commonly used for analog transmission.
• A coaxial cable consists of a stiff copper wire as the core, surrounded by an insulating material.
• The insulator is encased by a cylindrical conductor, often as a closely woven braided mesh.
• The outer conductor is covered in a protective plastic sheath.
• A cutaway view of a coaxial cable is shown in Fig. 2-4.

• Figure 2-4. A coaxial cable.


• The construction and shielding of the coaxial cable give it a good combination of high bandwidth
andexcellent noise immunity.
• The bandwidth possible depends on the cable quality and length.
• Modern cables have a bandwidth of up to a few GHz.
• Coax is still widely used for cable television and metropolitan area Networks.

• BNC connectors
1.BNC connector: Used in
TV2.BNCT: Ethernet
network
3.BNC terminator:End of the cable to prevent the reflection of the signal

Fiber-Optic Cable
• A fiber-optic cable is made of glass or plastic and transmits signals in the form of light.
• The outer jacket is made of either PVC or Teflon. Inside the jacket are Kevlar strands to strengthen the
cable.
• Below the Kevlar is another plastic coating to cushion the fiber. The fiber is at the center of the cable, and
it consists of cladding and core.
When a light ray passes from one medium to another—for example, from fused silica to air—the ray is refracted
(bent) at the silica/air boundary, as shown in

Figure (a) Three examples of a light ray from inside a silica fiber impinging on the air/silica boundary at
differentangles. (b) Light trapped by total internal reflection Here we see a light ray incident on the boundary
at an angle α emerging at an angle β1.

The amount of refraction depends on the properties of the two media (in particular, their indicesof refraction).

For angles of incidence above a certain critical value, the light is refracted back into the silica; none of it
escapesinto the air.
Thus, a light ray incident at or above the critical angle is trapped inside the fiber, as shown inFig. 2-6(b), and
can propagate for many kilometers with virtually no loss. The sketch of Fig. 2-6(b) shows only one trapped
ray, but since Any light ray incident on the boundary above the critical angle will be reflected internally,many
different rays will be bouncing around at different angles.

Propagation Modes:
Multimode Step-Index Fiber:
 The density of the core remains constant from the center to the edges.
 A beam of light moves through this constant density in a straight line until it reaches the interface of the
core and the cladding.
 At the interface, there is an abrupt change due to a lower density; this alters the angle of the beam's
motion.
 The term step index refers to the suddenness of this change, which contributes to the distortion of the
signal as it passes through the fiber.
Multimode Graded-Index Fiber:
 It decreases the distortion of the signal through the cable.
 The word index here refers to the index of refraction.
 The index of refraction is related to density. A graded- index fiber is one with varying densities.
 Density is highest at the center of the core and decreases gradually to its lowest at the edge.
Single-Mode Fiber:
• It uses step- index fiber and a highly focused source of light that limits beams to a small range of angles
close to the horizontal.
• The single mode fiber is manufactured with a much smaller diameter than that of multimode fiber, and
with substantially lower density (index of refraction).
• The decrease in density results in a critical angle that is close enough to 90° to make the propagation of
beams almost horizontal.
• In this case, propagation of different beams is almost identical, and delays are negligible.
• All the beams arrive at the destination "together" and can be recombined with little distortion to the
signal.
Wireless Transmission

UNGUIDED MEDIA (or) WIRELESS COMMUNICATION

Unguided media transport Electromagnetic Waves without using a physical conductor. This type
of communication is often referred to as wireless communication. Electromagnetic spectrum
ranging from 3 kHz to 900 THz used for wireless communication.
Categories of Wireless Communication:
Radio Waves ( 3kHz – 1GHz)
Microwaves ( 1GHz- 300 GHz)
Infrared Waves (300 GHz - 400 THz)
Radio Waves
• Radio waves ranges between 3 kHz and 1 GHz. Radio waves are Omni-directional.
• When an antenna transmits radio waves, they are propagated in all directions. Hence the
sendingand receiving devices don’t have to be aligned.
• A sending antenna sends waves that can be received by any receiving antenna.

Advantage
• Radio waves can travel long distances, hence it is used in long distance AM Radio
broadcasting.Radio waves of low and medium frequencies can penetrate walls.
Disadvantage
• The Omni-directional property has a disadvantage; the radio waves transmitted by one antenna
are susceptible to interference by another antenna that may send signals using the same
frequency or band.
• Radio waves leads to low data rate for digital communication.
Applications
• Radio waves are used in Multicasting applications such as AM Radio and FM radio, Television,
Maritime Radio, Cordless Phones, and Paging.
Microwaves

• Electromagnetic waves having frequencies between 1GHz and 300 GHz are called microwaves.
Microwaves are unidirectional. When an antenna transmits microwave waves, they canbe
narrowlyfocused. This means that the sending and receiving antennas need to be aligned.
• Microwaves need unidirectional antennas that send out signals in one direction. Two types of
antennas are used for microwave communications: the parabolic dish and the horn.
• Microwave propagation is line-of-sight. Repeaters are often needed for long distance
communication.
• Higher data rates are possible due to assigning of wider sub-bands.
Advantage
The unidirectional property has an obvious advantage. A pair of antennas can be aligned without
interfering with another pair of aligned antennas.
Disadvantage
Very high- frequency microwaves cannot penetrate walls. This characteristic can be a
disadvantageif receivers are inside buildings.
Applications
Microwaves used in Uni-casting communication between sender and receiver such as cellular
phones, satellite networks and wireless LANs.

Infrared Waves
Infrared waves, with frequencies from 300 GHz to 400 THz (wavelengths from 1 mm to 770
nm),can be used for short-range communication upto few meters.
Advantages
Infrared waves having high frequencies cannot penetrate walls. This advantageous characteristic
prevents interference between one system and another; a short-range communication system in one
room cannot be affected by another system in the next room.
Disadvantage
We cannot use Infrared waves for long range communication.
We cannot use infrared waves outside a building because the sun's rays contain infrared
wavesthat can interfere with the communication.
Applications
Due to its wide bandwidth, it can be used to transmit digital data at high data rate.
It can be used in Communication between devices such as keyboards, mice, PCs, and printers

Data Link Layer

The responsibility of the Physical Layer is to transmit the unstructured raw bit stream over a
physical medium.
The responsibility of Data-Link Layer is to transforming raw transmission facility into a
link responsible for node-to-node communication (hop-to-hop communication).
Responsibilities of the Data Link Layer include:
1. Framing
2. Physical Addressing
3. Flow control
4. Error control
5. Media Access Control.
Framing
The data link layer divides the stream of bits received from the network layer into manageable
data units called frames. In simple terms data link layer is responsible for moving frames from
one node to another node.
Physical Addressing
The data link layer adds a header to the frame to define the addresses of the sender and receiver
of the frame.
Flow Control
If the rate at which the data are absorbed by the receiver is less than the rate at which data are
produced in the sender, the data link layer imposes a flow control mechanism to avoid
overwhelming the receiver.
Error Control
The data link layer also adds reliability to the physical layer by adding mechanisms to detect
and retransmit damaged, duplicate, or lost frames.
Media Access Control
When two or more devices are connected to the same link, data link layer protocols are
necessary to determine which device has control over the link at any given time.

FUNCTIONS OF DATA LINK LAYER


The functionality and sub functionalities of Data Link Layer are given below:
Data Link layer

Data Link Control Media Access


Control

Flow and Error Control Protocols


Framing

Noiseless Noisy

Stop & Wait Go Back N – Selective


Simplest Stop and Repeat- ARQ
ARQ ARQ
Wait
Note:
1. Physical layer transfers bits in the form of a signal from the source to the destination.
2. The data link layer converts bits into frames, so that each frame is distinguishable from another.
Framing
• Framing is a process of adding source address and destination address to message.
• The destination address defines where the packet is to go.
• The sender or source address helps the receiver to acknowledge the receipt.
• If the message is large we will divide the message into several frames. Because larger frames causes
flow and error control problems, if any single bit error occurs we have to retransmit the entire
message this consumes a lot time.
• If a message is divided into smaller frames the single bit error can effect only one frame.
Framing can be done in 2 ways:
• Fixed size framing: The size of the frame is fixed for all the frames. There is no need to define
the boundaries of a frame.
• Variable size framing: In variable-size framing, we need a way to define the end of the frame
and the beginning of the next frame.
There are 2 approaches are used for variable size framing:
1. Character Stuffing (A Character-Oriented Approach)
2. Bit Stuffing (A Bit-Oriented Approach)

Character Stuffing / Byte Stuffing


In a character stuffing, data to be carried are 8-bit characters from a coding system such as
ASCII. The Frame format in Character Stuffing is given below:

Character Stuffing uses: Header, Trailer and a Flag.


• Header carries the source and destination addresses and other control information.
• Trailer which carries error detection or error correction redundant bits, these are also multiples
of 8 bits.
• To separate one frame from the next frame, an 8-bit (1-byte) Flag is added at the beginning and
the end of a frame. The flag signals receiver either start or end of a frame.

Disadvantages of Character Stuffing


• Character oriented framing is useful for text transfer not useful for audio video etc.
• Any pattern used for the flag could also be part of the information.
• If this happens, the receiver, when it encounters this pattern in the middle of the data, thinks it
has reached the end of the frame and the treats the next bit as new frame.
To fix this problem a Byte Stuffing strategy is introduced.
• In byte stuffing a special byte is added to the data section of the frame when there is a character
with the same pattern as the flag.
• The data section is stuffed with an extra byte called Escape character (ESC).
• Whenever the receiver encounters the ESC character, it removes it from the data section and
treats the next character as data, not a delimiting flag.
Figure shows the byte stuffing and Unstuffing:

Problems with Byte Stuffing


• If the text contains one or more escape characters followed by a flag, the receiver removes the
escape character, but keeps the flag, which is incorrectly interpreted as the end of the frame.
Solution
• To solve this problem, the escape characters that are part of the text must also be marked by
another escape character.

Disadvantages of character / Byte stuffing Procedure


• The universal coding systems (Unicode) in use today have 16-bit and 32-bit characters that
conflict with 8-bit characters.
• Character stuffing deals with 8-bit characters but todays systems using 16 bits, 32 bits and 64 bit
characters hence there will be conflict.
The solution for this problem is using Bit Oriented Approach.

Bit stuffing
• It is used for text, graphic, audio, video, and so on.
• In bit stuffing the data section of a frame is a sequence of bits to be interpreted by the upper
layer.
• In addition to header and trailer, we need a delimiter to separate one frame from other frame.
• Most protocols use a special 8-bit pattern flag 01111110 as the delimiter to define the beginning
and the end of the frame.
Frame format in bit stuffing is give below figure:

• In bit stuffing, if a 0 and five consecutive 1- bits are encountered, an extra 0 is added.
• This extra stuffed bit is eventually removed from the data by the receiver.
Note: the extra bit is added after one 0 followed by five 1s regardless of the value of the next
bit. (i.e.) when 01111100 is a part of the data, then also we have to add “0” after five 1‟s .
Hence the data will be 011111000

Advantages of Bit Stuffing


If the flag like pattern 01111110 appears in the data, it will change to 011111010 (stuffed) and
is not mistaken as a flag by the receiver. The real flag 01111110 is not stuffed by the sender
and is recognized by the receiver.

Error Detection and Correction


Data can be Corrupted during Transmission. Applications require that errors to be Detected and
Corrected. To detect or correct errors Redundancy concept is used. That
means:
• Networks must be able to transfer data from one device to another with acceptable accuracy.
• For most applications, a system must guarantee that the data received are identical to the data
transmitted.
• Any time data are transmitted from one node to the next node, they can become corrupted in
passage. Many factors can alter one or more bits of a message.
• Hence applications require a mechanism for detecting and correcting errors.
Note: Some applications can tolerate a small level of Error.
For Example: Random errors in audio or video transmissions may be tolerable, but when we
transfer text, we expect a very high level of accuracy.
Types of Errors
Whenever bits flow from one point to another, they are subject to unpredictable changes
because of interference. (Noise in the interface makes errors)

Single Bit Error Burst Error


Only 1 bit of a given data unit (such as a 2 or more bits in the data unit have changed from 1
byte, character, or packet) is changed from to 0 or from 0 to 1.
1 to 0 or from 0 to 1.

• A burst error is more likely to occur than a single-bit error.


• The duration of noise is normally longer than the duration of 1 bit, which means that when noise
affects data, it affects a set of bits.
• The number of bits affected depends on the data rate and duration of noise.
• For example, if we are sending data at I kbps, a noise of 11100 s can affect 10 bits; if we are
sending data at 1Mbps, the same noise can affect 10,000 bits.

Redundancy
• To be able to detect or correct errors, we need to send some extra bits (Redundant bits) with our
data.
• These redundant bits are added by the sender and removed by the receiver.
• Redundant bits allow the receiver to detect or correct corrupted bits.

Detection versus Correction


The correction of errors is more difficult than the detection.

Error Detection Error Correction


1. In error detection, it is used to find any 1. In error correction, we need to know the
errors are occurred. exact number of bits that are corrupted and
their location in the message.
2. We are not interested in the number of 2. The number of the errors and the size of the
errors. message are important factors.
3. A single-bit error is the same as a burst 3. If we need to correct one single error in an 8-
error. bit data unit, we need to consider eight
possible error locations; if we need to correct
two errors in a data unit of the same
size, we need to consider 28 possibilities.
ERROR DETECTION AND CORRECTION

Some channels in telecommunications networks, have tiny error rates .They cannot be avoided at a
reasonable expense or cost in terms of performance. So We have to learn how to deal with them.
Network designers have developed two basic strategies for dealing with errors. Both add
redundant information to the data that is sent.
(1) One strategy is to include enough redundant information to enable the receiver to deduce what the
transmitted data must have been.
(2) The other is to include only enough redundancy to allow the receiver to deduce that an error has
occurred (but not which error) and have it request a retransmission.

The former strategy uses error-correcting codes and particularly used for noisy channels, and in
higher layers, particularly for real-time media and content distribution , The use of error-correcting
codes is often referred to as FEC (Forward Error Correction).and the latter uses error-detecting
codes are commonly used in link, network, and transport layers.

Error-Correcting Codes

We will examine four different error-correcting codes:


1. Hamming codes.
2. Binary convolutional codes.
3. Reed-Solomon codes.
4. Low-Density Parity Check codes.

(1) Hamming code:

The Hamming Code method is a network technique designed by R.W.Hamming, for damage and error
detection during data transmission between multiple network channels.The Hamming Code method is
one of the most effective ways to detect single-data bit errors in the original data at the receiver end. It is
not only used for error detection but is also for correcting errors in the data bit.
Let’s look into some important terms related to the hamming code.

Important Terms for Hamming Code


To begin with, the steps involved in the detection and correction of data using hamming code, we need
to understand some important terms and expressions, which are:
1. Redundant Bits - These are the extra binary bits added externally into the original data bit to prevent
damage to the transmitted data and are also needed to recover the original data.
The expression applied to deduce the redundant value is,
2r >= d+r+1
Where,
d - “Data Bits”
r - “Redundant Bits”, r = {1, 2, 3, …….. n}
Example: Assuming the number of data bits is 7, find the number of redundant bits.
• 2^r >= r+7+1
• 2^4 >=4+8 [r=4]
The number of redundant bits = 4.

2. Parity Bits - The parity bit is the method to append binary bits to ensure that the total count of 1’s in
the original data is even bit or odd. It is also applied to detect errors on the receiver side and correct
them.
Types of parity bits:
• Odd Parity bits - In this parity type, the total number of 1’s in the data bit should be odd in count,
then the parity value is 0, and the value is 1.
• Even Parity bits - In this parity type, the total number of 1’s in the data bit should be even in
count; then the parity value is 0, and the value is 1.
Now we will look into step by step working of the hamming code.

Working of Hamming Code


To solve the data bit issue with the hamming code method, some steps need to be followed:
• Step 1 - The position of the data bits and the number of redundant bits in the original data. The
number of redundant bits is deduced from the expression [2^r >= d+r+1].
• Step 2 - Fill in the data bits and redundant bit, and find the parity bit value using the expression
[2^p, where, p - {0,1,2, …… n}].
• Step 3 - Fill the parity bit obtained in the original data and transmit the data to the receiver side.
• Step 4 - Check the received data using the parity bit and detect any error in the data, and in case
damage is present, use the parity bit value to correct the error.
Next, we will solve an example using hamming code to clarify any doubts regarding the working steps.
Example for Hamming Code

To better understand the working of the hamming code, the following example is to be solved:
The data bit to be transmitted is 1011010, to be solved using the hamming code method.

(1) Determining the Number of Redundant Bits and Position in the Data,
The data bits = 7
The redundant bit,
2^r >= d+r+1
2^4 >= 7+4+1
16 >= 12, [So, the value of r = 4.]
Position of the redundant bit, applying the 2^p expression:
• 2^0 - P1
• 2^1 - P2
• 2^2 - P4
• 2^3 - P8

Applying the data bits in Fig. 1.

• Finding the Parity Bits, for ”Even parity bits,”


1. P1 parity bit is deduced by checking all the bits with 1’s in the least significant location.
P1: 1, 3, 5, 7, 9, 11
• P1 - P1, 0, 1, 1, 1, 1
• P1 - 0
2. P2 parity bit is deduced by checking all the bits with 1’s in the second significant location.
P2: 2, 3, 6, 7, 10, 11
• P2 - P2, 0, 0, 1, 0, 1
• P2 - 0
3. P4 parity bit is deduced by checking all the bits with 1’s in the third significant location.
P4: 4, 5, 6, 7
• P4 - P4, 1, 0, 1
• P4 - 0
4. P8 parity bit is deduced by checking all the bits with 1’s in the fourth significant location.
P8: 8, 9, 10, 11
• P8 - P1, 1, 0, 1
• P8 - 0
So, the original data to be transmitted to the receiver side is:

• Error Detecting and Correction of the Data Received,


Assume that during transmission, the data bit at position 7 is changed from 1 to 0. Then by applying the
parity bit technique, we can identify the error:
Parity values obtained in the above deduction vary from the originally deduced parity values, proving
that an error occurred during data transmission.
To identify the position of the error bit, use the new parity values as,
• [0+2^2+2^1+2^0]
• 7, i.e., same as the assumed error position.
To correct the error, simply reverse the error bit to its complement, i.e., for this case, change 0 to 1, to
obtain the original data bit.
With the completion of the example for hamming code, we can conclude this article on “Hamming Code
for Error Detection and Correction.”

Hamming Distance
• Hamming distance is central concepts in coding for error control.
• The Hamming distance between two words of the same size is the number of differences between
the corresponding bits.
• Hamming distance between two words x and y is represented as d(x, y).
• The Hamming distance can easily be found if we apply the XOR operation on the two words and
count the number of 1‟s in the result.
Note: Hamming distance is a value greater than zero.
Example:
Find the Hamming distance between two pairs of words
1. The Hamming distance d(000, 011) is 2 because 000 011 is 011 (two 1‟s)
2. The Hamming distance d(10101, 11110) is 3 because 10101 11110 is 01011 (three 1‟s).
Minimum Hamming Distance (dmin)
The Minimum Hamming distance is the smallest Hamming distance between all possible
pairs in a set of words.
Example : Find the minimum Hamming distance of the coding scheme. d(00000, 01011) = 3
d(01011, 10101) = 4 d(00000,10101) = 3
d(0l011, 11110) = 3 d(00000, 11110) = 4 d(10101, 11110) =3
The dmin in this case is 3.
(2) Binary Convolutional codes

• In a convolutional code, an encoder processes a sequence of input bits and generates a sequence
of output bits.
• The output depends on the current and previous input bits. That is, the encoder has memory.
• The number of previous bits on which the output depends is called the constraint length of the
code.
• Convolutional codes are specified in terms of their rate and constraint length.Convolutional
codes are widely used in deployed networks, for example, as part of the GSM mobile phone
system, in satellite communications, and in 802.11.

As an example, a popular convolutional code is shown in Fig. 3-7. This code is known as the NASA
convolutional code of r = 1/2 and k = 7, since it was first used for the Voyager space missions starting
in 1977. Since then it has been liberally reused, for example, as part of 802.11.

In Fig. 3-7, each input bit on the left-hand side produces two output bits on the right-hand side that are
XOR sums of the input and internal state. Since it deals with bits and performs linear operations, this is a
binary, linear convolutional code. Since 1 input bit produces 2 output bits, the code rate is 1/2.

The internal state is kept in six memory registers. Each time another bit is input the values in the
registers are shifted to the right. For example, if 111 is input and the initial state is all zeros, the internal
state, written left to right, will become 100000, 110000, and 111000 after the first, second, and third bits
have been input. The output bits will be 11, followed by 10, and then 01. It takes seven shifts to flush an
input completely so that it does not affect the output. The constraint length of this code is thus k = 7.

(3) Read Solemon codes

• Read-Solomon codes are linear block codes, and they are often systematic too. Reed-Solomon
codes operate on m bit symbols.
• Reed-Solomon codes are widely used in practice because of their strong error-correction
properties, particularly for burst errors. They are used for DSL, data over cable, satellite
communications, and perhaps most ubiquitously on CDs, DVDs, and Blu-ray discs. Because they
are based on m bit symbols, a single-bit error and an m-bit burst error are both treated simply as
one symbol error.
• When 2t redundant symbols are added, a Reed-Solomon code is able to correct up to t errors in
any of the transmitted symbols.

key concepts such as symbols, parity, encoder, and decoder.


(1) Symbols
• Reed-Solomon codes operate on symbols, not individual bits. A symbol can be a group of bits,
typically represented as an element of a Galois Field (finite field).
• Example: In a system using 8-bit symbols, each symbol represents a byte (256 possible values).
This allows RS codes to detect and correct errors at the symbol level.
• Finite Field (Galois Field, GF): Symbols are elements of a finite field GF(2^m), where m is the
number of bits in each symbol. For example, GF(256) is used when symbols are 8 bits (one byte)
long.
(2) Parity
• Parity Symbols: These are additional symbols generated by the Reed-Solomon encoder and
appended to the original message. Parity symbols provide redundancy, allowing the detection and
correction of errors in the received message.
• The number of parity symbols depends on the code parameters, typically described as RS(n, k):
o n = total number of symbols (data + parity)
o k = number of original data symbols
o n - k = number of parity symbols
• Error Detection and Correction: The RS code can correct up to ttt errors, where t=n−k2t = \frac{n
- k}{2}t=2n−k. This means that the more parity symbols you add, the more errors you can detect
and correct.
(3)Encoder
• Purpose: The Reed-Solomon encoder takes the original data and adds parity symbols to it. The
encoder uses a generator polynomial to calculate the parity symbols.
• How it Works: The encoder treats the original message as a polynomial and multiplies it by the
generator polynomial. The result is then divided by another polynomial (usually a known
constant) to obtain the remainder, which forms the parity symbols. The final encoded message
consists of the original data followed by the parity symbols.
• Generator Polynomial: This is a carefully designed polynomial used to generate the parity
symbols. It is based on the specific error-correction properties of the RS code.

(4)Decoder

• Purpose: The Reed-Solomon decoder's job is to detect and correct any errors in the received
message. It attempts to reconstruct the original data from the possibly corrupted message by using
the parity symbols.
• How it Works:
1. Syndrome Calculation: The decoder first checks whether there are errors by calculating a
"syndrome." This involves evaluating the received message with the generator polynomial.
If the syndrome is zero, there are no errors; otherwise, errors are present.
2. Error Location: If errors are detected, the decoder uses an algorithm (such as the
Berlekamp-Massey algorithm or Euclid's algorithm) to locate the positions of the errors.
3. Error Correction: Once the error locations are known, the decoder can determine the error
values and correct them, reconstructing the original message.
• Error Detection: Even if the message has too many errors to be fully corrected, the decoder can
still detect errors and signal that the message was corrupted.
Example: RS(255, 223)
• n = 255: The total message length is 255 symbols.
• k = 223: The original data contains 223 symbols.
• Parity = 32 symbols: There are 32 parity symbols.
• Error Correction: This RS code can correct up to 322=16\frac{32}{2} = 16232=16 symbol errors.

(4) LDPC (Low-Density Parity Check) code.

• LDPC codes are linear block codes that were invented by Robert Gallagher in his doctoral thesis
(Gallagher, 1962). Like most theses, they were promptly forgotten, only to be reinvented in
1995 when advances in computing power had made them practical.
• In an LDPC code, each output bit is formed from only a fraction of the input bits.
• This leads to a matrix representation of the code that has a low density of 1s, hence the name for
the code.
• The received codewords are decoded with an approximation algorithm that iteratively
improves on a best fit of the received data to a legal codeword. This corrects errors.
• LDPC codes are practical for large block sizes and have excellent error-cor- rection abilities that
outperform many other codes (including the ones we have looked at) in practice.
• For this reason they are rapidly being included in new protocols.
• They are part of the standard for digital video broadcasting, 10 Gbps Ethernet, power-line
networks, and the latest version of 802.11. Expect to see more of them in future networks.

Error Detecting Codes


1.Parity check
2.Cyclic Redundancy Check
3. Check sum algorithm

(1) Parity check:

• A parity bit is a check bit, which is added to a block of data for error detection purposes.
• It is used to validate the integrity of the data. The value of the parity bit is assigned either 0
or 1 that makes the number of 1s in the message block either even or odd depending upon
the type of parity.
• Parity check is suitable for single bit error detection only.
• The two types of parity checking are
Even Parity − Here the total number of bits in the message is made even.
Odd Parity − Here the total number of bits in the message is made odd.

Example for Error Detection by Adding Parity Bit

Sender's End – While creating a frame, the sender counts the number of 1s in it and adds the
parity bit following way
• In case of even parity − If number of 1s is even, parity bit value is 0. If number of 1s is
odd, parity bit value is 1.
• In case of odd parity − If number of 1s is odd, parity bit value is 0. If number of 1s is even,

parity bit value is 1.


Receiver's End − On receiving a frame, the receiver counts the number of 1s in it. In case of even
parity check, if the count of 1s is even, the frame is accepted, otherwise it is rejected. In case
of odd parity check, if the count of 1s is odd, the frame is accepted, otherwise it is rejected.

Example
Suppose that a sender wants to send the data 1001101 using even parity check method. It will add
the parity bit as shown below.

The receiver will decide whether error has occurred by counting whether the total number of 1s is
even. When the above frame is received, three cases may occur namely, no error, single bit error
detection and failure to detect multiple bits error. This is illustrated as follows
Cyclic Redundancy Check (CRC)

Cyclic Redundancy Check (CRC) is an error-detecting code used to detect accidental changes to raw
data. CRCs are widely used in digital networks and storage devices to ensure the integrity of data.
Unlike error-correcting codes like Reed-Solomon, which can both detect and correct errors, CRCs are
primarily designed to detect errors.

1. Purpose of CRC:
o CRC is designed to detect errors in a message. It can detect common types of errors, such
as:
▪ Single-bit errors
▪ Double-bit errors
▪ Burst errors (multiple consecutive bit errors)
▪ Errors affecting an odd number of bits
o It does not correct the errors but simply indicates that errors are present.
2. How CRC Works:
o CRC operates by performing binary division of the data by a predetermined generator
polynomial. The remainder of this division is appended to the message and transmitted
along with the original data.
o When the receiver gets the message, it performs the same division. If the remainder
matches, the data is considered valid (no errors detected); otherwise, an error is flagged.
3. CRC Components
1. Message (Data):
o This is the original data or message that is being transmitted or stored. The length of the
message can vary.
2. Generator Polynomial:
o A key element in the CRC process is the generator polynomial (or divisor), which is a
predetermined binary number used for division.
o The choice of the generator polynomial affects the types of errors that the CRC can detect.
It is usually chosen to maximize error detection capabilities.
o Example of a common CRC generator polynomial:
▪ CRC-32 uses the polynomial:
x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1x^{32} + x^{26} +
x^{23} + x^{22} + x^{16} + x^{12} + x^{11} + x^{10} + x^8 + x^7 + x^5 + x^4
+ x^2 + x + 1x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1
3. Remainder (CRC Value):
o The remainder after dividing the message by the generator polynomial is the CRC value
(often called the "checksum").
o This remainder is appended to the message before transmission or storage.
o The receiver divides the received message (including the CRC value) by the same
generator polynomial. If the remainder is zero, the data is considered error-free; otherwise,
errors are detected.

CRC Encoder
• In the encoder, the dataword has k bits and the codeword has n bits.
• The size of the dataword is augmented by adding (n – k) number of 0’s to the right-hand side of
the word.
• The n-bit result is fed into the generator.
• The generator uses a divisor of size n - k + 1 predefined and agreed by both sender and reciever.
• The generator divides the augmented dataword by the divisor (modulo-2 division).
• The quotient ofthe division is discarded;
• The remainder (r2r1 r0) is appended to the dataword to create the codeword.
Let us take k=4
bits n=7 bits
Appended Dataword Size = (n-k) = 3.
Divisor Size = (n-k+1) =4.
Example:
The encoder takes the dataword and augments it with (n – k) number of 0‟s. It then divides
the augmented dataword by the divisor. Let us take the divisor 1011.
The value 1011 will agreed by both sender and receiver.

Note: We use XOR operation in the above division.


• As in decimal division, the process is done step by step.
• In each step, a copy of the divisor is XORed with the 4 bits of the dividend.
• The result of the XOR operation (remainder) is 3 bits is used for the next step after 1 extra bit is
pulled down to make it 4 bits long.
• If the leftmost bit of the dividend is 0, the step cannot use the regular divisor; we need to use an
all-0‟s divisor.
• When there are no bits left to pull down, we have a result.
• The 3-bit remainder forms the check bits (r2r1 r0). They are appended to the dataword to create
the codeword.

CRC Decoder
• The codeword can change during transmission.
• The decoder does the same division process as the encoder.
• The remainder of the division is the syndrome.
• If the syndrome is all 0‟s, there is no error; the dataword is separated from the received codeword
and accepted. Otherwise, everything is discarded.
The below figure shows two cases:
• The left-hand figure shows the value of syndrome when no error has occurred; the syndrome is
000.
• The right-hand part of the figure shows the case in which there is one single error. The syndrome
is not all 0‟s (it is 011).

You might also like