DCCN 1
DCCN 1
Problems.
PEO3: To inculcate professional and ethical attitude, effective communication skills,
Teamwork skills, multidisciplinary approach, entrepreneurial thinking and an ability to
Relate engineering issues with social issues.
PEO4: To provide students with an academic environment aware of excellence, leadership,
Written ethical codes and guidelines, and the self-motivated life-long learning needed
For a successful professional career.
PEO5: To prepare students to excel in Industry and Higher education by Educating Students
Along with High moral values and Knowledge.
Syllabus
Unit-I
Introduction
Overview:
A system of interconnected computers and computerized peripherals such as printers is called
computer network. This interconnection among computers facilitates information sharing among
them. Computers may connect to each other by either wired or wireless media.
Geographical Span:
Geographically a network can be seen in one of the following categories:
• It may be spanned across your table, among Bluetooth enabled devices, Ranging not more
than few meters.
• It may be spanned across a whole building, including intermediate devices to connect all
floors.
• It may be spanned across a whole city.
• It may be spanned across multiple cities or provinces.
• It may be one network covering whole world
Inter-Connectivity:
Components of a network can be connected to each other differently in some fashion. By
connectedness we mean either logically, physically, or both ways.
• Every single device can be connected to every other device on network, making the network
mesh
. • All devices can be connected to a single medium but geographically disconnected, created
bus-like structure.
• Each device is connected to its left and right peers only, creating linear structure.
• All devices connected together with a single device, creating star-like structure.
• All devices connected arbitrarily using all previous ways to connect each other, resulting in a
hybrid structure.
Administration:
From an administrator’s point of view, a network can be private network which belongs a single
autonomous system and cannot be accessed outside its physical or logical domain. A network
can be public, which is accessed by all.
Network Architecture:
Computer networks can be discriminated into various types such as Client-Server, peer-to-peer
or hybrid, depending upon its architecture.
• There can be one or more systems acting as Server. Other being Client, requests the Server to
serve requests. Server takes and processes request on behalf of Clients.
• Two systems can be connected Point-to-Point, or in back-to-back fashion. They both reside at
the same level and called peers.
• There can be hybrid network which involves network architecture of both the above types.
Network Applications:
Computer systems and peripherals are connected to form a network. They provide numerous
advantages:
• Resource sharing such as printers and storage devices
• Exchange of information by means of e-Mails and FTP
• Information sharing by using Web or Internet
• Interaction with other users using dynamic web pages
• IP phones
• Video conferences
• Parallel computing
• Instant messaging
For example, Piconet is Bluetooth-enabled Personal Area Network which may contain up to 8
devices connected together in a master-slave fashion.
LANs are composed of inexpensive networking and routing equipment. It may contains local
servers serving file storage and other locally shared applications. It mostly operates on private IP
addresses and does not involve heavy routing. LAN works under its own local domain and
controlled centrally. LAN uses either Ethernet or Token-ring technology. Ethernet is most widely
employed LAN technology and uses Star topology, while Token-ring is rarely seen. LAN can be
wired, wireless, or in both forms at once.
Internetwork
A network of networks is called an internetwork, or simply the internet. It is the largest network
in existence on this planet. The internet hugely connects all WANs and it can have connection to
LANs and Home networks. Internet uses TCP/IP protocol suite and uses IP as its addressing
protocol. Present day, Internet is widely implemented using IPv4. Because of shortage of address
spaces, it is gradually migrating from IPv4 to IPv6.
Internet enables its users to share and access enormous amount of information worldwide. It uses
WWW, FTP, email services, audio, and video streaming etc. At huge level, internet works on
Client-Server model.
Internet uses very high speed backbone of fiber optics. To inter-connect various continents,
fibers are laid under sea known to us as submarine communication cable.
Internet is widely deployed on World Wide Web services using HTML linked pages and is
accessible by client software known as Web Browsers. When a user requests a page using some
web browser located on some Web Server anywhere in the world, the Web Server responds with
the proper HTML page. The communication delay is very low.
Internet is serving many proposes and is involved in many aspects of life. Some of them are:
• Web sites
• E-mail
• Instant Messaging
• Blogging
• Social Media
• Marketing
• Networking
• Resource Sharing
• Audio and Video Streaming
Unit-II
• Server −Servers are high-configuration computers that manage the resources of the
network. The network operating system is typically installed in the server and so they
give user accesses to the network resources. Servers can be of various kinds: file servers,
database servers, print servers etc.
• Peers − Peers are computers that provide as well as receive services from other peers in a
workgroup network.
• Clients − Clients are computers that request and receive service from the servers to
access and use the network resources.
• Transmission Media − Transmission media are the channels through which data is
transferred from one device to another in a network. Transmission media may be guided
media like coaxial cable, fiber optic cables etc.; or maybe unguided media like
microwaves, infra-red waves etc.
• Connecting Devices − Connecting devices act as middleware between networks or
computers, by binding the network media together. Some of the common connecting
devices are:
a. Routers
b. Bridges
c. Hubs
d. Repeaters
e. Gateways
f. Switches
Software Components:
• Protocol Suite − A protocol is a rule or guideline followed by each computer for data
communication. Protocol suite is a set of related protocols that are laid down for
computer networks. The two popular protocol suites are −
b. TCP / IP Model
Network Topologies
In computer networking, topology refers to the layout of connected devices, i.e. how the
computers, cables, and other components within a data communications network are
interconnected, both physically and logically. The physical topology describes how the
network is actually laid out, and the logical topology describes how the data actually flow
through the network. Two most basic topologies are point-to-point and multipoint. A
point to-point topology usually connects two mainframe computers for high-speed digital
information. A multipoint topology connects three or more stations through a single
transmission medium and some examples are star, bus, ring, mesh and hybrid.
Star topology:
A star topology is designed with each node (file server, workstations, and peripherals)
connected directly to a central network hub, switch, or concentrator. Data on a star network
passes through the hub, switch, or concentrator before continuing to its destination. The
hub, switch, or concentrator manages and controls all functions of the network. It also acts
as a repeater for the data flow.
Bus topology:
Bus networks use a common backbone to connect all devices. A single cable, (the
backbone) functions as a shared communication medium that devices attach or tap into
with an interface connector. A device wanting to communicate with another device on the
network sends a broadcast message onto the wire that all other devices see, but only the
intended recipient actually accepts and processes the message. The bus topology is the
simplest and most common method of interconnecting computers. The two ends of the
transmission line never touch to form a complete loop. A bus topology is also known as
multi drop or linear bus or a horizontal bus.
Ring topology:
In a ring network (sometimes called a loop), every device has exactly two neighbors for
communication purposes. All messages travel through a ring in the same direction (either
"clockwise" or "counter clockwise"). All the stations are interconnected in tandem
(series) to form a closed loop or circle. Transmissions are unidirectional and must
propagate through all the stations in the loop. Each computer acts like a repeater and the
ring topology is similar to bus or star topologies.
Mesh topology:
The mesh topology incorporates a unique network design in which each computer on the
network connects to every other, creating a point-to-point connection between every
device on the network. Unlike each of the previous topologies, messages sent on a mesh
network can take any of several possible paths from source to destination. A mesh
network in which every device connects to every other is called a full mesh. A
disadvantage is that, a mesh network with n nodes must have n (n-1)/2 links and each
node must have n-1 I/O ports (links).
Hybrid topology:
This topology (sometimes called mixed topology) is simply combining two or more of the
traditional topologies to form a larger, more complex topology. Main aim is being able to share
the advantages of different topologies.
Protocols & Standards
Protocol: A protocol is a set of rules that govern data communications. It represents an agreement
between the communicating devices.
• Syntax
• Semantics
• Timing
An association of organizations, governments, manufacturers and users form the standards
organizations and are responsible for developing, coordinating and maintaining the standards. The
intent is that all data communications equipment manufacturers and users comply with these
standards. The primary standards organizations for data communication are
OSI model
The OSI model is a layered framework for the design of network systems that allows
communication between all types of computer systems. It consists of seven separate but related
layers, each of which defines a part of the process of moving information across a network.
1. Physical Layer
The physical layer coordinates the functions required to carry a bit stream over a physical
medium. It deals with the mechanical and electrical specifications of the interface and
transmission medium. It also defines the procedures and functions that physical devices
and interfaces have to perform for transmission to occur.
3. Network Layer
The network layer is responsible for the source-to-destination delivery of a packet, possibly
across multiple networks (links). Whereas the data link layer oversees the delivery of the
packet between two systems on the same network (links), the network layer ensures that
each packet gets from its point of origin to its final destination. If two systems are
connected to the same link, there is usually no need for a network layer. However, if the
two systems are attached to different networks (links) with connecting devices between the
networks (links), there is often a need for the network layer to accomplish source-to-
destination delivery. Other responsibilities of the network layer include the following:
• Logical addressing.
• Routing
4. Transport Layer
The transport layer is responsible for process-to-process delivery of the entire message. A
process is an application program running on a host. Whereas the network layer oversees
source to-destination delivery of individual packets, it does not recognize any relationship
between those packets. It treats each one independently, as though each piece belonged to
a separate message, whether or not it does. The transport layer, on the other hand, ensures
that the whole message arrives intact and in order, overseeing both error control and flow
control at the source to-destination level. Other responsibilities of the transport layer
include the following:
• Service-point addressing
• o Segmentation and reassembly
• Connection control
• Flow control
• Error control
5. Session Layer
The services provided by the first three layers (physical, data link, and network) are not
sufficient for some processes. The session layer is the network dialog controller. It
establishes, maintains, and synchronizes the interaction among communicating systems.
Specific responsibilities of the session layer include the following:
• Dialog control
• Synchronization.
6. Presentation Layer
The presentation layer is concerned with the syntax and semantics of the information
exchanged between two systems. Specific responsibilities of the presentation layer include
the following:
• Translation
• Encryption
• Compression
7. Application Layer
The application layer enables the user, whether human or software, to access the network.
It provides user interfaces and support for services such as electronic mail, remote file
access and transfer, shared database management, and other types of distributed
information services. Specific services provided by the application layer include the
following:
• Network virtual terminal
• File transfer, access, and management
• Mail services
• Directory services
TCP/IP model
TCP/IP model is a set of communication protocols that allow communication across multiple
diverse networks. TCP/IP is a hierarchical protocol comprised of either three or four layers. The
three-layer version of TCP/IP contains the network, transport and application layers. Four layer
version specifies the host to network layer.
The TCP/IP transport layer deals with the quality-of-service issues of reliability, flow control, and
error correction. One of its protocols, the transmission control protocol (TCP), provides excellent
and flexible ways to create reliable, well-flowing, low-error network communications. TCP is a
connection-oriented protocol. The other protocol is User Datagram Protocol (UDP) which is a
connection less protocol.
Differences between OSI and TCP/IP
• TCP/IP combines the presentation and session layer issues into its application layer
• TCP/IP combines the OSI data link and physical layers into one layer
• TCP/IP appears simpler because it has fewer layers
• TCP/IP protocols are the standards around which the Internet developed, so the TCP/IP
model gains credibility just because of its protocols. In contrast, typically networks aren't
built on the OSI protocol, even though the OSI model is used as a guide.
Signals
When data is sent over physical medium, it needs to be first converted into electromagnetic signals.
Data itself can be analog such as human voice, or digital such as file on the disk. Both analog and
digital data can be represented in digital or analog signals.
Digital Signals
Digital signals are discrete in nature and represent sequence of voltage pulses. Digital signals are
used within the circuitry of a computer system.
Analog Signals
Analog signals are in continuous wave form in nature and represented by continuous
electromagnetic waves.
Transmission Impairment: When signals travel through the medium, they tend to deteriorate.
This may have many reasons as given:
• Attenuation
• Dispersion
• Delay distortion
• Noise
• Thermal Noise
• Intermodulation
• Crosstalk
• Impulse
Transmission Media
The media over which the information between two computer systems is sent, called transmission
media. Transmission media comes in two forms.
Guided Media
All communication wires/cables are guided media, such as UTP, coaxial cables, and fiber Optics.
In this media, the sender and receiver are directly connected and the information is send (guided)
through it.
Unguided Media
Wireless or open air space is said to be unguided media, because there is no connectivity between
the sender and receiver. Information is spread over the air, and anyone including the actual
recipient may collect the information.
DIGITAL TRANSMISSION
Data or information can be stored in two ways, analog and digital. For a computer to use the data,
it must be in discrete digital form. Similar to data, signals can also be in analog and digital form.
To transmit data digitally, it needs to be first converted to digital form.
Digital-to-Digital Conversion
This section explains how to convert digital data into digital signals. It can be done in two ways,
line coding and block coding. For all communications, line coding is necessary whereas block
coding is optional.
Line Coding
The process for converting digital data into digital signal is said to be Line Coding. Digital data is
found in binary format. It is represented (stored) internally as series of 1s and 0s.
Digital signal is denoted by discreet signal, which represents digital data. There are three types of
line coding schemes available:
Unipolar Encoding
Unipolar encoding schemes use single voltage level to represent data. In this case, to represent
binary 1, high voltage is transmitted and to represent 0, no voltage is transmitted. It is also called
Unipolar-Non-return-to-zero, because there is no rest condition i.e. it either represents 1 or 0.
Polar Encoding
Polar encoding scheme uses multiple voltage levels to represent binary values. Polar encodings is
available in four types:
• Polar Non Return to Zero (Polar NRZ)
• Return to Zero (RZ)
• Manchester
• Differential Manchester
Bipolar Encoding
Bipolar encoding uses three voltage levels, positive, negative, and zero. Zero voltage represents
binary 0 and bit 1 is represented by altering positive and negative voltages.
Analog-to-Digital Conversion
Microphones create analog voice and camera creates analog videos, which are treated is analog
data. To transmit this analog data over digital signals, we need analog to digital conversion.
Analog data is a continuous stream of data in the wave form whereas digital data is discrete. To
convert analog wave into digital data, we use Pulse Code Modulation (PCM). PCM is one of the
most commonly used method to convert analog data into digital form. It involves three steps:
• Sampling
• Quantization
• Encoding
Transmission Modes
The transmission mode decides how data is transmitted between two computers. The binary data
in the form of 1s and 0s can be sent in two different modes: Parallel and Serial.
ANALOG TRANSMISSION
To send the digital data over an analog media, it needs to be converted into analog signal. There
can be two cases according to data formatting.
Bandpass: The filters are used to filter and pass frequencies of interest. A bandpass is a band of
frequencies which can pass the filter.
Low-pass: Low-pass is a filter that passes low frequencies signals.
When digital data is converted into a bandpass analog signal, it is called digital-to analog
conversion. When low-pass analog signal is converted into bandpass analog signal, it is called
analog-to-analog conversion.
Digital-to-Analog Conversion
When data from one computer is sent to another via some analog carrier, it is first converted into
analog signals. Analog signals are modified to reflect digital data. An analog signal is characterized
by its amplitude, frequency, and phase. There are three kinds of digital-to-analog conversions:
Amplitude Shift Keying
In this conversion technique, the amplitude of analog carrier signal is modified to reflect binary
data.
When binary data represents digit 1, the amplitude is held; otherwise it is set to 0. Both frequency
and phase remain same as in the original carrier signal.
When a new binary symbol is encountered, the phase of the signal is altered. Amplitude and
frequency of the original carrier signal is kept intact.
Analog-to-Analog Conversion
Analog signals are modified to represent analog data. This conversion is also known as Analog
Modulation. Analog modulation is required when bandpass is used. Analog to analog conversion
can be done in three ways:
1. Amplitude Modulation
In this modulation, the amplitude of the carrier signal is modified to reflect the analog data.
Amplitude modulation is implemented by means of a multiplier. The amplitude of
modulating signal (analog data) is multiplied by the amplitude of carrier frequency, which
then reflects analog data. The frequency and phase of carrier signal remain unchanged.
Frequency Modulation
In this modulation technique, the frequency of the carrier signal is modified to reflect the
change in the voltage levels of the modulating signal (analog data).
Phase Modulation
In the modulation technique, the phase of carrier signal is modulated in order to reflect the
change in voltage (amplitude) of analog data signal.
Phase modulation is practically similar to Frequency Modulation, but in Phase modulation
frequency of the carrier signal is not increased. Frequency of carrier is signal is changed
(made dense and sparse) to reflect voltage change in the amplitude of modulating signal.
TRANSMISSION MEDIA
The transmission media is nothing but the physical media over which communication takes
place in computer networks.
Magnetic Media
One of the most convenient way to transfer data from one computer to another, even before
the birth of networking, was to save it on some storage media and transfer physical from
one station to another. Though it may seem old-fashion way in today’s world of high speed
internet, but when the size of data is huge, the magnetic media comes into play.
Coaxial Cable
Coaxial cable has two wires of copper. The core wire lies in the center and it is made of
solid conductor. The core is enclosed in an insulating sheath. The second wire is wrapped
around over the sheath and that too in turn encased by insulator sheath. This all is covered
by plastic cover.
Because of its structure, the coax cable is capable of carrying high frequency signals than
that of twisted pair cable. The wrapped structure provides it a good shield against noise
and cross talk. Coaxial cables provide high bandwidth rates of up to 450 mbps.
There are three categories of coax cables namely, RG-59 (Cable TV), RG-58 (Thin
Ethernet), and RG-11 (Thick Ethernet). RG stands for Radio Government. Cables are
connected using BNC connector and BNC-T. BNC terminator is used to terminate the wire
at the far ends.
Power Lines
Power Line communication (PLC) is Layer-1 (Physical Layer) technology which uses
power cables to transmit data signals. In PLC, modulated data is sent over the cables. The
receiver on the other end de-modulates and interprets the data.
There are two types of PLCs:
• Narrow band PLC
• Broad band PLC
Fiber Optics
Fiber Optic works on the properties of light. When light ray hits at critical angle, it tends to refracts
at 90 degree. This property has been used in fiber optic. The core of fiber optic cable is made of
high quality glass or plastic. From one end of it light is emitted, it travels through it and at the other
end light detector detects light stream and converts it to electric data.
Fiber Optic provides the highest mode of speed. It comes in two modes, one is single mode fiber
and second is multimode fiber. Single mode fiber can carry a single ray of light whereas multimode
is capable of carrying multiple beams of light.
Fiber Optic also comes in unidirectional and bidirectional capabilities. To connect and access fiber
optic special type of connectors are used. These can be Subscriber Channel (SC), Straight Tip
(ST), or MT-RJ.
Unit-III
2. Framing: Frames are the streams of bits received from the network layer into
manageable data units. This division of stream of bits is done by Data Link Layer.
3. Physical Addressing: The Data Link layer adds a header to the frame in order to define
physical address of the sender or receiver of the frame, if the frames are to be distributed
to different systems on the network.
4. Flow Control: A receiving node can receive the frames at a faster rate than it can process
the frame. Without flow control, the receiver's buffer can overflow, and frames can get
lost. To overcome this problem, the data link layer uses the flow control to prevent the
sending node on one side of the link from overwhelming the receiving node on another
side of the link.
5. Error Control: Error control is achieved by adding a trailer at the end of the frame.
Duplication of frames are also prevented by using this mechanism. Data Link Layers
adds mechanism to prevent duplication of frames.
Error detection: Errors can be introduced by signal attenuation and noise. Data Link
Layer protocol provides a mechanism to detect one or more errors. This is achieved by
adding error detection bits in the frame and then receiving node can perform an error
check.
Error correction: Error correction is similar to the Error detection, except that receiving
node not only detects the errors but also determine where the errors have occurred in the
frame.
6. Access Control: Protocols of this layer determine which of the devices has control over
the link at any given time, when two or more devices are connected to the same link.
7. Reliable delivery: Data Link Layer provides a reliable delivery service, i.e., transmits the
network layer datagram without any error. A reliable delivery service is accomplished with
transmissions and acknowledgements. A data link layer mainly provides the reliable delivery
service over the links as they have higher error rates and they can be corrected locally, link at
which an error occurs rather than forcing to retransmit the data.
8. Half-Duplex & Full-Duplex: In a Full-Duplex mode, both the nodes can transmit the data at
the same time. In a Half-Duplex mode, only one node can transmit the data at the same time.
FRAMING:
To provide service to the network layer, the data link layer must use the service provided to it by
the physical layer. What the physical layer does is accept a raw bit stream and attempt to deliver
it to the destination. This bit stream is not guaranteed to be error free. The number of bits
received may be less than, equal to, or more than the number of bits transmitted, and they may
have different values. It is up to the data link layer to detect and, if necessary, correct errors. The
usual approach is for the data link layer to break the bit stream up into discrete frames and
compute the checksum for each frame (framing). When a frame arrives at the destination, the
checksum is recomputed. If the newly computed checksum is different from the one contained in
the frame, the data link layer knows that an error has occurred and takes steps to deal with it
(e.g., discarding the bad frame and possibly also sending back an error report).We will look at
four framing methods:
1. Character count.
2. Flag bytes with byte stuffing.
3. Starting and ending flags, with bit stuffing.
4. Physical layer coding violations.
Stop-and-wait Protocol
It is still very simple. The sender sends one frame and waits for feedback from the
receiver. When the ACK arrives, the sender sends the next frame It is Stop-and-Wait
Protocol because the sender sends one frame, stops until it receives confirmation from the
receiver (okay to go ahead), and then sends the next frame. We still have unidirectional
communication for data frames, but auxiliary ACK frames (simple tokens of
acknowledgment) travel from the other direction. We add flow control to our previous
protocol.
NOISY CHANNELS
Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its
predecessor, noiseless channels are nonexistent. We can ignore the error (as we
sometimes do), or we need to add error control to our protocols. We discuss three
protocols in this section that use error control.
Receiver window: variable Rn (receive window, next frame expected) the sequence
numbers to the left of the window belong to the frames already received and
acknowledged; the sequence numbers to the right of this window define the frames that
cannot be received. Any received frame with a sequence number in these two regions is
discarded. Only a frame with a sequence number matching the value of Rn is accepted
and acknowledged. The receive window also slides, but only one slot at a time. When a
correct frame is received (and a frame is received only one at a time), the window slide
(see below figure for receiving window) The receive window is an abstract concept
defining an imaginary box of size 1 with one single variable Rn. The window slides when
a correct frame has arrived; sliding occurs one slot at a time.
Below figure is an example (if ack lost) of a case where the forward channel is reliable,
but the reverse is not. No data frames are lost, but some ACKs are delayed and one is
lost. The example also shows how cumulative acknowledgments can help if
acknowledgments are delayed or lost
Sender Window (explain go-back N sender window concept (before & after sliding.)
The only difference in sender window between Go-back N and Selective Repeat is
Window size)
Receiver window
The receiver window in Selective Repeat is totally different from the one in Go Back-N.
First, the size of the receive window is the same as the size of the send window (2m-1).
The Selective Repeat Protocol allows as many frames as the size of the receiver window
to arrive out of order and be kept until there is a set of in order frames to be delivered to
the network layer. Because the sizes of the send window and receive window are the
same, all the frames in the send frame can arrive out of order and be stored until they can
be delivered. However the receiver never delivers packets out of order to the network
layer. Above Figure shows the receive window. Those slots inside the window that are
colored define frames that have arrived out of order and are waiting for their neighbors to
arrive before delivery to the network layer. In Selective Repeat ARQ, the size of the
sender and receiver window must be at most one-half of 2m.
Flow Diagram
Differences between Go-Back N & Selective Repeat
One main difference is the number of timers. Here, each frame sent or resent needs a
timer, which means that the timers need to be numbered (0, 1,2, and 3). The timer for
frame 0 starts at the first request, but stops when the ACK for this frame arrives.
There are two conditions for the delivery of frames to the network layer: First, a set of
consecutive frames must have arrived. Second, the set starts from the beginning of the
window. After the first arrival, there was only one frame and it started from the beginning
of the window. After the last arrival, there are three frames and the first one starts from
the beginning of the window.
The next point is about the ACKs. Notice that only two ACKs are sent here. The first one
acknowledges only the first frame; the second one acknowledges three frames. In
Selective Repeat, ACKs are sent when data are delivered to the network layer. If the data
belonging to n frames are delivered in one shot, only one ACK is sent for all of them.
ALOHA
1 Pure ALOHA
The original ALOHA protocol is called pure ALOHA. This is a simple, but elegant
protocol. The idea is that each station sends a frame whenever it has a frame to send.
However, since there is only one channel to share, there is the possibility of collision
between frames from different stations. Below Figure shows an example of frame
collisions in pure ALOHA.
In pure ALOHA, the stations transmit frames whenever they have data to send.
When two or more stations transmit simultaneously, there is collision and the frames are
destroyed.
• In pure ALOHA, whenever any station transmits a frame, it expects the
acknowledgement from the receiver.
• If acknowledgement is not received within specified time, the station assumes that the
frame (or acknowledgement) has been destroyed.
• If the frame is destroyed because of collision the station waits for a random amount of
time and sends it again. This waiting time must be random otherwise same frames will
collide again and again.
• Therefore pure ALOHA dictates that when time-out period passes, each station must
wait for a random amount of time before resending its frame. This randomness will help
avoid more collisions.
Vulnerable time let us find the length of time, the vulnerable time, in which there is a
possibility of collision. We assume that the stations send fixed length frames with each frame
taking Tfr S to send. Below Figure shows the vulnerable time for station A.
Station A sends a frame at time t. Now imagine station B has already sent a frame
between t - Tfr and t. This leads to a collision between the frames from station A and
station B. The end of B's frame collides with the beginning of A's frame. On the other
hand, suppose that station C sends a frame between t and t + Tfr . Here, there is a
collision between frames from station A and station C. The beginning of C's frame
collides with the end of A's frame Looking at Figure, we see that the vulnerable time,
during which a collision may occur in pure ALOHA, is 2 times the frame transmission
time. Pure ALOHA vulnerable time = 2 x Tfr
2 Slotted ALOHA
In slotted ALOHA we divide the time into slots of Tfr s and force the station to send only
at the beginning of the time slot. Figure 3 shows an example of frame collisions in slotted
ALOHA
Because a station is allowed to send only at the beginning of the synchronized time slot,
if a station misses this moment, it must wait until the beginning of the next time slot. This
means that the station which started at the beginning of this slot has already finished
sending its frame. Of course, there is still the possibility of collision if two stations try to
send at the beginning of the same time slot. However, the vulnerable time is now reduced
to one-half, equal to Tfr
Vulnerable Time
The vulnerable time for CSMA is the propagation time Tp . This is the time needed for a
signal to propagate from one end of the medium to the other. When a station sends a
frame, and any other station tries to send a frame during this time, a collision will result.
But if the first bit of the frame reaches the end of the medium, every station will already
have heard the bit and will refrain from sending.
Persistence Methods:
1. Persistent
2. Non-Persistent
3. P-Pesistent
Error Detection
Error
A condition when the receiver’s information does not matches with the sender’s information.
During transmission, digital signals suffer from noise that can introduce errors in the binary bits
travelling from sender to receiver. That means a 0 bit may change to 1 or a 1 bit may change to
0.
Error Detecting Codes: Whenever a message is transmitted, it may get scrambled by noise or
data may get corrupted. To avoid this, we use error-detecting codes which are additional data
added to a given digital message to help us detect if any error has occurred during transmission
of the message. Basic approach used for error detection is the use of redundancy bits, where
additional bits are added to facilitate detection of errors. Some popular techniques for error
detection are:
1. Simple Parity check
2. Two-dimensional Parity check
3. Checksum
4. Cyclic redundancy check
Error Correction
Error Correction codes are used to detect and correct the errors when data is transmitted from the
sender to the receiver
Error Correction can be handled in two ways:
Backward error correction: Once the error is discovered, the receiver requests the sender to
retransmit the entire data unit.
Forward error correction: In this case, the receiver uses the error-correcting code which
automatically corrects the errors. A single additional bit can detect the error, but cannot correct
it.
For correcting the errors, one has to know the exact position of the error. For example, if we
want to calculate a single-bit error, the error correction code will determine which one of seven
bits is in error. To achieve this, we have to add some additional redundant bits.
Suppose r is the number of redundant bits and d is the total number of the data bits. The number
of redundant bits r can be calculated by using the formula: 2 r >=d+r+1 the value of r is
calculated by using the above formula. For example, if the value of d is 4, then the possible
smallest value that satisfies the above relation would be 3.
To determine the position of the bit which is in error, a technique developed by R.W Hamming is
Hamming code which can be applied to any length of the data unit and uses the relationship
between data units and redundant units.
Hamming Code Parity bits: The bit which is appended to the original data of binary bits so that
the total number of 1s is even or odd.
Even parity: To check for even parity, if the total number of 1s is even, then the value of the
parity bit is 0. If the total number of 1s occurrences is odd, then the value of the parity bit is 1.
Odd Parity: To check for odd parity, if the total number of 1s is even, then the value of parity
bit is 1. If the total number of 1s is odd, then the value of parity bit is 0.
Algorithm of hamming code:
An information of 'd' bits are added to the redundant bits 'r' to form d+r. The location of each of
the (d+r) digits is assigned a decimal value. The 'r' bits are placed in the positions 1,2,.....2k-1 At
the receiving end, the parity bits are recalculated. The decimal value of the parity bits determines
the position of an error.
Relationship b/w Error position & binary number
Determining r2 bit: The r2 bit is calculated by performing a parity check on the bit positions
whose binary representation includes 1 in the second position.
Determining r4 bit: The r4 bit is calculated by performing a parity check on the bit positions
whose binary representation includes 1 in the third position.
Piggybacking
A technique called piggybacking is used to improve the efficiency of the bidirectional protocols.
When a frame is carrying data from A to B, it can also carry control information about arrived
(or lost) frames from B; when a frame is carrying data from B to A, it can also carry control
information about the arrived (or lost) frames from
Unit-IV
Network Layer
DESIGN ISSUES
In the following sections, we will give an introduction to some of the issues that the designers of
the network layer must grapple with. These issues include the service provided to the transport
layer and the internal design of the network.
This equipment is used as follows. A host with a packet to send transmits it to the nearest router,
either on its own LAN or over a point-to-point link to the ISP. The packet is stored there until it
has fully arrived and the link has finished its processing by verifying the checksum. Then it is
forwarded to the next router along the path until it reaches the destination host, where it is
delivered. This mechanism is store-and-forward packet switching.
When a device has multiple paths to reach a destination, it always selects one path by preferring
it over others. This selection process is termed as Routing. Routing is done by special network
devices called routers or it can be done by means of software processes. The software based
routers have limited functionality and limited scope.
A router is always configured with some default route. A default route tells the router where to
forward a packet if there is no route found for specific destination. In case there are multiple path
existing to reach the same destination, router can make decision based on the following
information:
• Hop Count
• Bandwidth
• Metric
• Prefix-length
• Delay
Routes can be statically configured or dynamically learnt. One route can be configured to be
preferred over others.
Unicast routing
Most of the traffic on the internet and intranets known as unicast data or unicast traffic is sent
with specified destination. Routing unicast data over the internet is called unicast routing. It is
the simplest form of routing because the destination is already known. Hence the router just has
to look up the routing table and forward the packet to next hop.
Broadcast routing
By default, the broadcast packets are not routed and forwarded by the routers on any network.
Routers create broadcast domains. But it can be configured to forward broadcasts in some special
cases. A broadcast message is destined to all network devices.
A router creates a data packet and then sends it to each host one by one. In this case, the router
creates multiple copies of single data packet with different destination addresses. All packets are
sent as unicast but because they are sent to all, it simulates as if router is broadcasting.
• This method consumes lots of bandwidth and router must destination address of each
node.
• Secondly, when router receives a packet that is to be broadcasted, it simply floods those
packets out of all interfaces. All routers are configured in the same way.
• This method is easy on router’s CPU but may cause the problem of duplicate packets
received from peer routers.
• Reverse path forwarding is a technique, in which router knows in advance about its
predecessor from where it should receive broadcast. This technique is used to detect and
discard duplicates.
Multicast Routing
Multicast routing is special case of broadcast routing with significance difference and
challenges. In broadcast routing, packets are sent to all nodes even if they do not want it.
But in Multicast routing, the data is sent to only nodes which wants to receive the
packets.
The router must know that there are nodes, which wish to receive multicast packets (or stream)
then only it should forward. Multicast routing works spanning tree protocol to avoid looping.
Multicast routing also uses reverse path Forwarding technique, to detect and discard duplicates
and loops.
Routing Algorithms
Flooding
Flooding is simplest method packet forwarding. When a packet is received, the routers send it to
all the interfaces except the one on which it was received. This creates too much burden on the
network and lots of duplicate packets wandering in the network.
Time to Live (TTL) can be used to avoid infinite looping of packets. There exists another
approach for flooding, which is called Selective Flooding to reduce the overhead on the network.
In this method, the router does not flood out on all the interfaces, but selective ones.
Shortest Path
Routing decision in networks, are mostly taken on the basis of cost between source and
destination. Hop count plays major role here. Shortest path is a technique which uses various
algorithms to decide a path with minimum number of hops.
Common shortest path algorithms are:
• Dijkstra's algorithm
• Bellman Ford algorithm
• Floyd Warshall algorithm
INTERNETWORKING
In real world scenario, networks under same administration are generally scattered
geographically. There may exist requirement of connecting two different networks of same kind
as well as of different kinds. Routing between two networks is called internetworking.
Networks can be considered different based on various parameters such as, Protocol, topology,
Layer-2 network and addressing scheme.
In internetworking, routers have knowledge of each other’s address and addresses beyond them.
They can be statically configured go on different network or they can learn by using
internetworking routing protocol.
Routing protocols which are used within an organization or administration are called Interior
Gateway Protocols or IGP. RIP, OSPF are examples of IGP. Routing between different
organizations or administrations may have Exterior Gateway Protocol, and there is only one EGP
i.e. Border Gateway Protocol.
Tunneling
If they are two geographically separate networks, which want to communicate with each other,
they may deploy a dedicated line between or they have to pass their data through intermediate
networks.
Tunneling is a mechanism by which two or more same networks communicate with each other,
by passing intermediate networking complexities. Tunneling is configured at both ends.
When the data enters from one end of Tunnel, it is tagged. This tagged data is then routed inside
the intermediate or transit network to reach the other end of Tunnel. When data exists the Tunnel
its tag is removed and delivered to the other part of the network.
Packet Fragmentation
Most Ethernet segments have their maximum transmission unit (MTU) fixed to 1500 bytes. A
data packet can have more or less packet length depending upon the application. Devices in the
transit path also have their hardware and software capabilities which tell what amount of data
that device can handle and what size of packet it can process.
If the data packet size is less than or equal to the size of packet the transit network can handle, it
is processed neutrally. If the packet is larger, it is broken into smaller pieces and then forwarded.
This is called packet fragmentation. Each fragment contains the same destination and source
address and routed through transit path easily. At the receiving end it is assembled again.
If a packet with DF (do not fragment) bit set to 1 comes to a router which cannot handle the
packet because of its length, the packet is dropped.
When a packet is received by a router has its MF (more fragments) bit set to 1, the router then knows that
it is a fragmented packet and parts of the original packet is on the way.
If packet is fragmented too small, the overhead is increases. If the packet is fragmented too large,
intermediate router may not be able to process it and it might get dropped.
Once the host gets destination MAC address, it can communicate with remote host using Layer-2
link protocol. This MAC to IP mapping is saved into ARP cache of both sending and receiving
hosts. Next time, if they require to communicate, they can directly refer to their respective ARP
cache.
Reverse ARP is a mechanism where host knows the MAC address of remote host but requires to
know IP address to communicate.
Transport Layer:
Transport layer offers peer-to-peer and end-to-end connection between two processes on remote
hosts. Transport layer takes data from upper layer (i.e. Application layer) and then breaks it into
smaller size segments, numbers each byte, and hands over to lower layer (Network Layer) for
delivery.
Functions
• This Layer is the first one which breaks the information data, supplied by Application
layer in to smaller units called segments. It numbers every byte in the segment and
maintains their accounting.
• This layer ensures that data must be received in the same sequence in which it was sent.
• This layer provides end-to-end delivery of data between hosts which may or may not
belong to the same subnet.
• All server processes intend to communicate over the network are equipped with well-
known Transport Service Access Points (TSAPs) also known as port numbers.
Features
• TCP is reliable protocol. That is, the receiver always sends either positive or negative
acknowledgement about the data packet to the sender, so that the sender always has
bright clue about whether the data packet is reached the destination or it needs to resend
it.
• TCP ensures that the data reaches intended destination in the same order it was sent.
• TCP is connection oriented. TCP requires that connection between two remote points be
established before sending actual data.
• TCP provides error-checking and recovery mechanism.
• TCP provides end-to-end communication.
• TCP provides flow control and quality of service.
• TCP operates in Client/Server point-to-point mode.
• TCP provides full duplex server, i.e. it can perform roles of both receiver and sender.
Header
• Source Port (16-bits): It identifies source port of the application process on the sending
device.
• Destination Port (16-bits): It identifies destination port of the application process on the
receiving device.
• Sequence Number (32-bits): Sequence number of data bytes of a segment in a session.
• Acknowledgement Number (32-bits): When ACK flag is set, this number contains the
next sequence number of the data byte expected and works as acknowledgement of the
previous data received.
• Data offset (4-bits): This field implies both, the size of TCP header (32-bit words) and
the offset of data in current packet in the whole TCP segment.
• Reserved (3-bits): Reserved for future use and all are set zero by default.
• Flags (1-bit each):
NS: Nonce Sum bit is used by Explicit Congestion Notification signaling process.
CWR: When a host receives packet with ECE bit set, it sets Congestion Windows
Reduced to acknowledge that ECE received.
ECE: It has two meanings:
• If SYN bit is clear to 0, then ECE means that the IP packet has its
CE (congestion experience) bit set.
• If SYN bit is set to 1, ECE means that the device is ECT capable.
URG: It indicates that Urgent Pointer field has significant data and should be processed.
ACK: It indicates that Acknowledgement field has significance. If ACK is cleared to 0, it
indicates that packet does not contain any acknowledgement.
PSH: When set, it is a request to the receiving station to PUSH data as soon as it comes
to the receiving application without buffering it.
RST: Reset flag has the following features:
Windows Size: This field is used for flow control between two stations and indicates the
amount of buffer (in bytes) the receiver has allocated for a segment, i.e. how much data is the
receiver expecting.
Checksum: This field contains the checksum of Header, Data, and Pseudo Headers.
Urgent Pointer: It points to the urgent data byte if URG flag is set to 1.
Options: It facilitates additional options which are not covered by the regular header. Option
field is always described in 32-bit words. If this field contains data less than 32-bit, padding is
used to cover the remaining bits to reach 32-bit boundary.
Addressing
TCP communication between two remote hosts is done by means of port numbers (TSAPs).
Ports numbers can range from 0 – 65535 which are divided as:
Connection Management
TCP communication works in Server/Client model. The client initiates the connection and the
server either accepts or rejects it. Three-way handshaking is used for connection management
Establishment
Client initiates the connection and sends the segment with a Sequence number. Server
acknowledges it back with its own Sequence number and ACK of client’s segment which is one
more than client’s Sequence number. Client after receiving ACK of its segment sends an
acknowledgement of Server’s response.
Release
Either of server and client can send TCP segment with FIN flag set to 1. When the receiving end
responds it back by Acknowledging FIN, that direction of TCP communication is closed and
connection is released.
Bandwidth Management
TCP uses the concept of window size to accommodate the need of Bandwidth management.
Window size tells the sender at the remote end the number of data byte segments the receiver at
this end can receive. TCP uses slow start phase by using window size 1 and increases the
window size exponentially after each successful communication.
For example, the client uses windows size 2 and sends 2 bytes of data. When acknowledgement
of this segment received the windows size is doubled to 4 and next the segment sent will be 4
data bytes long. When the acknowledgement of 4-byte data segment is received, the client sets
windows size to 8 and so on.
If an acknowledgement is missed, i.e. data lost in transit network or it received NACK, then the
window size is reduced to half and slow start phase starts again.
Congestion Control
When large amount of data is fed to system which is not capable of handling it, congestion
occurs. TCP controls congestion by means of Window mechanism. TCP sets a window size
telling the other end how much data segment to send. TCP may use three algorithms for
congestion control:
Timer Management
TCP uses different types of timers to control and management various tasks:
Keep-alive timer:
Retransmission timer:
Persist timer:
Timed-Wait:
• After releasing a connection, either of the hosts waits for a Timed-Wait time to terminate
the connection completely.
• This is in order to make sure that the other end has received the acknowledgement of its
connection termination request.
• Timed-out can be a maximum of 240 seconds (4 minutes).
Crash Recovery
TCP is very reliable protocol. It provides sequence number to each of byte sent in segment. It
provides the feedback mechanism i.e. when a host receives a packet, it is bound to ACK that
packet having the next sequence number expected (if it is not the last segment).
When a TCP Server crashes mid-way communication and re-starts its process, it sends TPDU
broadcast to all its hosts. The hosts can then send the last data segment which was never
unacknowledged and carry onwards.
The User Datagram Protocol (UDP) is simplest Transport Layer communication protocol
available of the TCP/IP protocol suite. It involves minimum amount of communication
mechanism. UDP is said to be an unreliable transport protocol but it uses IP services which
provides best effort delivery mechanism.
In UDP, the receiver does not generate an acknowledgement of packet received and in turn, the
sender does not wait for any acknowledgement of packet sent. This shortcoming makes this
protocol unreliable as well as easier on processing.
Requirement of UDP
A question may arise, why do we need an unreliable protocol to transport the data? We deploy
UDP where the acknowledgement packets share significant amount of bandwidth along with the
actual data. For example, in case of video streaming, thousands of packets are forwarded towards
its users. Acknowledging all the packets is troublesome and may contain huge amount of
bandwidth wastage. The best delivery mechanism of underlying IP protocol ensures best efforts
to deliver its packets, but even if some packets in video streaming get lost, the impact is not
calamitous and can be ignored easily. Loss of few packets in video and voice traffic sometimes
goes unnoticed.
Features
• UDP is used when acknowledgement of data does not hold any significance.
• UDP is good protocol for data flowing in one direction.
• UDP is simple and suitable for query based communications.
• UDP is not connection oriented.
• UDP does not provide congestion control mechanism.
• UDP does not guarantee ordered delivery of data.
• UDP is stateless.
• UDP is suitable protocol for streaming applications such as VoIP, multimedia streaming
UDP Header
UDP header is as simple as its function.
1. Source Port: This 16 bits information is used to identify the source port of the packet.
2. Destination Port: This 16 bits information is used identify application level service on
destination machine.
3. Length: Length field specifies the entire length of UDP packet (including header). It is 16-bits
field and minimum value is 8-byte, i.e. the size of UDP header itself.
4. Checksum: This field stores the checksum value generated by the sender before sending. IPv4
has this field as optional so when checksum field does not contain any value, it is made 0 and all
its bits are set to zero.
UDP application
Here are few applications where UDP is used to transmit data:
What is congestion?
A state occurring in network layer when the message traffic is so heavy that it slows down
network response time.
Effects of Congestion
• As delay increases, performance decreases.
• If delay increases, retransmission occurs, making situation worse.
Imagine a bucket with a small hole in the bottom. No matter at what rate water enters the
bucket, the outflow is at constant rate. When the bucket is full with water additional water
entering spills over the sides and is lost.
Similarly, each network interface contains a leaky bucket and the following steps are involved
in leaky bucket algorithm:
1. When host wants to send packet, packet is thrown into the bucket.
2. The bucket leaks at a constant rate, meaning the network interface transmits packets at a
constant rate.
3. Bursty traffic is converted to a uniform traffic by the leaky bucket.
4. In practice the bucket is a finite queue that outputs at a finite rate.
In figure (A) we see a bucket holding three tokens, with five packets waiting to be transmitted.
For a packet to be transmitted, it must capture and destroy one token. In figure (B) We see that
three of the five packets have gotten through, but the other two are stuck waiting for more
tokens to be generated.
Ways in which token bucket is superior to leaky bucket:
The leaky bucket algorithm controls the rate at which the packets are introduced in the
network, but it is very conservative in nature. Some flexibility is introduced in the token
bucket algorithm. In the token bucket, algorithm tokens are generated at each tick (up to a
certain limit). For an incoming packet to be transmitted, it must capture a token and the
transmission takes place at the same rate. Hence some of the busty packets are transmitted at
the same rate if tokens are available and thus introduces some amount of flexibility in the
system.
Formula: M * s = C + ρ * s
where S – is time taken
M – Maximum output rate
ρ – Token arrival rate
C – Capacity of the token bucket in byte
Unit-VI
Application Layer:
Application layer is the topmost layer in OSI and TCP/IP layered model. This layer exists in both
layered Models because of its significance, of interacting with user and user applications. This
layer is for applications which are involved in communication system.
A user may or may not directly interacts with the applications. Application layer is where the
actual communication is initiated and reflects. Because this layer is on the top of the layer stack,
it does not serve any other layers. Application layer takes the help of Transport and all layers
below it to communicate or transfer its data to the remote host.
When an application layer protocol wants to communicate with its peer application layer
protocol on remote host, it hands over the data or information to the Transport layer. The
transport layer does the rest with the help of all the layers below it.
There is an ambiguity in understanding Application Layer and its protocol. Not every user
application can be put into Application Layer except those applications which interact with the
communication system. For example, designing software or text editor cannot be considered as
application layer programs.
On the other hand, when we use a Web Browser, which is actually using Hyper Text Transfer
Protocol (HTTP) to interact with the network, HTTP is Application Layer protocol.
Another example is File Transfer Protocol, which helps a user to transfer text based or binary
files across the network. A user can use this protocol in either GUI based software like FileZilla
or Cute FTP and the same user can use FTP in Command Line mode. Hence, irrespective of
which software you use, it is the protocol which is considered at Application Layer used by that
software. DNS is a protocol which helps user application protocols such as HTTP to accomplish
its work.
Client (Browser):
• Web browser is a program, which is used to communicate with web server on the Internet.
• Each browser consists of three parts: a controller, client protocol and interpreter.
• The controller receives input from input device and use the programs to access the documents.
• After accessing the document, the controller uses one of the interpreters to display the document
on the screen
Server:
• A computer which is available for the network resources and provides service to the other
computer on request is known as server.
• The web pages are stored at the server.
• Server accepts a TCP connection from a client browser.
• It gets the name of the file required.
• Server gets the stored file. Returns the file to the client and releases the top connection.
CLIENT-SERVER MODEL
Two remote application processes can communicate mainly in two different fashions:
• Peer-to-peer: Both remote processes are executing at same level and they exchange data
using some shared resource.
• Client-Server: One remote process acts as a Client and requests some resource from another
application process acting as Server.
In client-server model, any process can act as Server or Client. Itis not the type of machine, size
of the machine, or its computing power which makes it server; it is the ability of serving request
that makes a machine a server.
A system can act as Server and Client simultaneously. That is, one process is acting as Server
and another is acting as a client. This may also happen that both client and server processes
reside on the same machine.
Communication
Two processes in client-server model can interact in various ways:
• Sockets
• Remote Procedure Calls (RPC)
Sockets
In this paradigm, the process acting as Server opens a socket using a well-known (or known by
client) port and waits until some client request comes. The second process acting as a Client also
opens a socket; but instead of waiting for an incoming request, the client processes ‘requests
first’.
When the request is reached to server, it is served. It can either be an information sharing or
resource request.
SECURITY ATTACKS
There are four general categories of attack which are listed below.
Interruption
An asset of the system is destroyed or becomes unavailable or unusable. This is an attack on
availability e.g., destruction of piece of hardware, cutting of a communication line or Disabling
of file management system.
Interception
An unauthorized party gains access to an asset. This is an attack on confidentiality. Unauthorized
party could be a person, a program or a compute.e.g. Wire tapping to capture data in the network,
illicit copying of files
Modification
An unauthorized party not only gains access to but tampers with an asset. This is an attack on
integrity. e.g., changing values in data file, altering a program, modifying the contents of
messages being transmitted in a network.
Fabrication
An unauthorized party inserts counterfeit objects into the system. This is an attack on
authenticity. e.g., insertion of spurious message in a network or addition of records to a file.