CN Notes
CN Notes
MODULE – 1 08 Hours
Introduction: Data Communications, Networks, Network Types, Internet History, Standards and Administration
Networks Models: Protocol Layering, TCP/IP Protocol suite, The OSI model
Introduction to Physical Layer-1: Data and Signals, Digital Signals, Transmission Impairment, Data Rate limits,
Performance Digital Transmission: Digital to digital conversion (Only Line coding: Polar, Bipolar and Manchester coding)
Physical Layer-2: Analog to digital conversion (only PCM), Transmission Modes
Analog Transmission: Digital to analog conversion
MODULE – 2 08 Hours
Data link control: DLC services, Data link layer protocols, HDLC, and Point to Point protocol (Framing,
Transition phases only). Error Detection and correction: Introduction, Block coding, Cyclic codes, Checksum,
Forward error correction, Media Access control: Random Access, Controlled Access and Channelization
DATA COMMUNICATION
1-1
DATA COMMUNICATION
1.8.4 Transmission of Digital Signals
1.8.4.1 Baseband Transmission
1.8.4.2 Broadband Transmission (Using Modulation)
1.9 TRANSMISSION IMPAIRMENT
1.9.1 Attenuation
1.9.1.1 Decibel
1.9.2 Distortion
1.9.3 Noise
1.9.3.1 Signal-to-Noise Ratio (SNR)
1.10 DATA RATE LIMITS
1.10.1 Noiseless Channel: Nyquist Bit Rate
1.10.2 Noisy Channel: Shannon Capacity
1.11 PERFORMANCE
1.11.1 Bandwidth
1.11.2 Throughput
1.11.3 Latency (Delay)
1.11.4 Bandwidth-Delay Product
1.11.5 Jitter
1.12 DIGITAL-TO-DIGITAL CONVERSION
1.12.1 Line Coding
1.12.1.1 Characteristics
1.12.2 Line Coding Schemes
1.12.2.1 Unipolar Scheme
1.12.2.2 Polar Schemes
1.12.2.3 Bipolar Schemes (or Multilevel Binary)
1-2
DATA COMMUNICATION
2.3.4.1.1 Implementation of BPSK
2.3.4.1.2 Bandwidth for BPSK
2.3.4.2 Quadrature PSK (QPSK)
2.3.4.3 Constellation Diagram
2.3.5 Quadrature Amplitude Modulation (QAM)
2.3.5.1 Bandwidth for QAM
2.3.5.2 TDM
QUESTIONS(MODULE 1)
MODULE 1: INTRODUCTION
1-3
DATA COMMUNICATION
1) Define digital to analog conversion? List different types of digital to analog conversion. (2)
2) Describe ASK, FSK and PSK mechanisms and apply them over the digital data 101101. (4)
3) Discuss the bandwidth requirement for ASK, FSK and PSK. (4*)
4) Explain different aspects of digital-to-analog conversion? (6*)
5) Define ASK. Explain BASK. (6*)
6) Define FSK. Explain BFSK. (6*)
7) Define PSK. Explain BPSK. (6*)
8) Explain QPSK. (6)
9) Explain the concept of constellation diagram. (6)
10)Explain QAM. (6)
1-4
DATA COMMUNICATION
MODULE 1: INTRODUCTION
1-5
DATA COMMUNICATION
1.1.1 Components of Communication System
• Five components of a communication-system (Figure 1.1):
1) Message
2) Sender
3) Receiver
4) Transmission-Medium
5) Protocol
1) Message
Message is the information (or data) to be communicated.
Message may consist of
→ number/text
→ picture or
→ audio/video
2) Sender
Sender is the device that sends the data-message.
Sender can be
→ computer and
→ mobile phone
3) Receiver
Receiver is the device that receives the message.
Receiver can be
→ computer and
→ mobile phone
4) Transmission Medium
Transmission-medium is physical-path by which a message travels from sender to receiver.
Transmission-medium can be wired or wireless.
Examples of wired medium:
→ twisted-pair wire (used in landline telephone)
→ coaxial cable (used in cable TV network)
→ fiber-optic cable
Examples of wireless medium:
→ radio waves
→ microwaves
→ infrared waves (ex: operating TV using remote control)
5) Protocol
A protocol is a set of rules that govern data-communications.
In other words, a protocol represents an agreement between the communicating-devices.
Without a protocol, 2 devices may be connected but not communicating.
1-6
DATA COMMUNICATION
1.1.2 Data Representation
• Five different forms of information:
1) Text
Text is represented as a bit-pattern. (Bit-pattern sequence of bits: 0s or 1s).
Different sets of bit-patterns are used to represent symbols (or characters).
Each set is called a code.
The process of representing symbols is called encoding.
Popular encoding system: ASCII, Unicode.
2) Number
Number is also represented as a bit-pattern.
ASCII is not used to represent number. Instead, number is directly converted to binary-form.
3) Image
Image is also represented as a bit-pattern.
An image is divided into a matrix of pixels (picture-elements).
A pixel is the smallest element of an image. (Pixel Small dot)
The size of an image depends upon number of pixels (also called resolution).
For example: An image can be divided into 1000 pixels or 10,000 pixels.
Two types of images:
i) Black & White Image
¤ If an image is black & white, each pixel can be represented by a value either 0 or 1.
¤ For example: Chessboard
ii) Color Image
¤ There are many methods to represent color images.
¤ RGB is one of the methods to represent color images.
¤ RGB is called so called ‘.’ each color is combination of 3 colors: red, green & blue.
4) Audio
Audio is a representation of sound.
By nature, audio is different from text, numbers, or images. Audio is continuous, not discrete.
5) Video
Video is a representation of movie.
Video can either
→ be produced as a continuous entity (e.g., by a TV camera), or
→ be a combination of images arranged to convey the idea of motion.
1-7
DATA COMMUNICATION
1.1.3 Direction of Data Flow
• Three ways of data-flow between 2 devices (Figure 1.2):
1) Simplex
2) Half-duplex
3) Full-duplex
1) Simplex
The communication is unidirectional
(For ex: The simplex mode is like a one-way street).
On a link, out of 2 devices:
i) Only one device can transmit.
ii) Another device can only receive.
For example (Figure 1.2a):
The monitor can only accept output.
Entire-capacity of channel is used to send the data in one direction.
2) Half Duplex
Both the stations can transmit as well as receive but not at the same time.
(For ex: The half-duplex mode is like a one-lane road with 2 directional traffic).
When one station is sending, the other can only receive and vice-versa.
For example (Figure 1.2b): Walkie-talkies
Entire-capacity of a channel is used by one of the 2 stations that are transmitting the data.
3) Full Duplex
Both stations can transmit and receive at the same time.
(For ex: The full-duplex is like a 2-way street with traffic flowing in both directions at the
same time).
For example (Figure 1.2c):
Mobile phones (When 2 people are communicating by a telephone line, both can listen
and talk at the same time)
Entire-capacity of a channel is shared by both the stations that are transmitting the data.
1-8
DATA COMMUNICATION
1.2 NETWORKS
• A network is defined as a set of devices interconnected by communication-links.
• This interconnection among computers facilitates information sharing among them.
• Computers may connect to each other by either wired or wireless media.
• Often, devices are referred to as nodes.
• A node can be any device capable of sending/receiving data in the network.
• For example: Computer & Printer
• The best-known computer network is the Internet.
1-9
DATA COMMUNICATION
1.2.2 Physical Structures
1.2.2.1 Type of Connection
• Two types of connections (Figure 1.3):
1) Point-to-Point
Only two devices are connected by a dedicated-link (Figure 1.3a).
Entire-capacity of the link is reserved for transmission between those two devices.
For example: Point-to-Point connection b/w remote-control & TV for changing the channels.
2) Multipoint (Multi-Drop)
Three or more devices share a single link.
The capacity of the channel is shared, either spatially or temporally (Figure 1.3b).
i) If link is used simultaneously by many devices, then it is spatially shared connection.
ii) If user takes turns while using the link, then it is time shared (temporal) connection.
(spatiallyspace or temporallytime)
1-10
DATA COMMUNICATION
1.2.2.2 Physical Topology
• The physical-topology defines how devices are connected to make a network.
• Four basic topologies are:
1) Mesh
2) Star
3) Bus and
4) Ring
1-11
DATA COMMUNICATION
1.2.2.2.2 Star Topology
• All the devices are connected to a central controller called a hub (Figure 1.5).
• There exists a dedicated point-to-point link between a device & a hub.
• The devices are not directly linked to one another. Thus, there is no direct traffic between devices.
• The hub acts as a junction:
If device-1 wants to send data to device-2,
the device-1 sends the data to the hub,
then the hub relays the data to the device-2.
• Advantages:
1) Less expensive: Each device needs only one link & one I/O port to connect it to any devices.
2) Easy installation & reconfiguration: Nodes can be added/removed w/o affecting the network.
3) Robustness: If one link fails, it does not affect the entire system.
4) Easy to detect and troubleshoot fault.
5) Centralized management: The hub manages and controls the whole network.
• Disadvantages:
1) Single point of failure: If the hub goes down, the whole network is dead.
2) Cable length required is the more compared to bus/ring topologies.
3) Number of nodes in network depends on capacity of hub.
1-12
DATA COMMUNICATION
1.2.2.2.3 Ring Topology
• Each device is connected to the next, forming a ring (Figure 1.6).
• There are only two neighbors for each device.
• Data travels around the network in one direction till the destination is reached.
• Sending and receiving of data takes place by the help of token.
• Each device has a repeater.
• A repeater
→ receives a signal on transmission-medium &
→ regenerates & passes the signal to next device.
• Advantages:
1) Easy installation and reconfiguration.
To add/delete a device, requires changing only 2 connections.
3) Fault isolation is simplified.
If one device does not receive a signal within a specified period, it can issue an alarm.
The alarm alerts the network-operator to the problem and its location.
3) Congestion reduced: Because all the traffic flows in only one direction.
• Disadvantages:
1) Unidirectional traffic.
2) A fault in the ring/device stops all transmission.
The above 2 drawbacks can be overcome by using dual ring.
3) There is a limit on
i) Cable length &
ii) Number of nodes that can be connected.
4) Slower: Each data must pass through all the devices between source and destination.
1-13
DATA COMMUNICATION
1.2.2.2.4 Mesh Topology
• All the devices are connected to each other (Figure 1.7).
• There exists a dedicated point-to-point link between all devices.
• There are n(n-1) physical channels to link n devices.
• Every device not only sends its own data but also relays data from other nodes.
• For ‘n’ nodes,
→ there are n(n-1) physical-links
→ there are n(n-1)/2 duplex-mode links
• Every device must have (n–1) I/O ports to be connected to the other (n-1) devices.
• Advantages:
1) Congestion reduced: Each connection can carry its own data load.
2) Robustness: If one link fails, it does not affect the entire system.
3) Security: When a data travels on a dedicated-line, only intended-receiver can see the data.
4) Easy fault identification & fault isolation: Traffic can be re-routed to avoid problematic links.
• Disadvantages:
1) Difficult installation and reconfiguration.
2) Bulk of wiring occupies more space than available space.
3) Very expensive: as there are many redundant connections.
4) Not mostly used in computer networks. It is commonly used in wireless networks.
5) High redundancy of the network-connections.
1-14
DATA COMMUNICATION
1.3 Network Types
• Two popular types of networks:
1) LAN (Local Area Network) &
2) WAN (Wide Area Network)
1.3.1 LAN
• LAN is used to connect computers in a single office, building or campus (Figure 1.8).
• LAN is usually privately owned network.
• A LAN can be simple or complex.
1) Simple: LAN may contain 2 PCs and a printer.
2) Complex: LAN can extend throughout a company.
• Each host in a LAN has an address that uniquely defines the host in the LAN.
• A packet sent by a host to another host carries both source host’s and destination host’s addresses.
• LANs use a smart connecting switch.
• The switch is able to
→ recognize the destination address of the packet &
→ guide the packet to its destination.
• The switch
→ reduces the traffic in the LAN &
→ allows more than one pair to communicate with each other at the same time.
• Advantages:
1) Resource Sharing
Computer resources like printers and hard disks can be shared by all devices on the network.
2) Expansion
Nowadays, LANs are connected to WANs to create communication at a wider level.
1-15
DATA COMMUNICATION
1.3.2 WAN
• WAN is used to connect computers anywhere in the world.
• WAN can cover larger geographical area. It can cover cities, countries and even continents.
• WAN interconnects connecting devices such as switches, routers, or modems.
• Normally, WAN is
→ created & run by communication companies (Ex: BSNL, Airtel)
→ leased by an organization that uses it.
• A WAN can be of 2 types:
1) Point-to-Point WAN
A point-to-point WAN is a network that connects 2 communicating devices through a
transmission media (Figure 1.9).
2) Switched WAN
A switched WAN is a network with more than two ends.
The switched WAN can be the backbones that connect the Internet.
A switched WAN is a combination of several point-to-point WANs that are connected by
switches (Figure 1.10).
1-16
DATA COMMUNICATION
1.3.2.1 Internetwork
• A network of networks is called an internet. (Internet inter-network) (Figure 1.12).
• For example (Figure 1.11):
Assume that an organization has two offices,
i) First office is on the east coast &
ii) Second office is on the west coast.
Each office has a LAN that allows all employees in the office to communicate with each other.
To allow communication between employees at different offices, the management leases a
point-to-point dedicated WAN from a ISP and connects the two LANs.
(ISP Internet service provider such as a telephone company ex: BSNL).
When a host in the west coast office sends a message to another host in the same office, the
router blocks the message, but the switch directs the message to the destination.
On the other hand, when a host on the west coast sends a message to a host on the east
coast, router R1 routes the packet to router R2, and the packet reaches the destination.
1-17
DATA COMMUNICATION
1.3.3 LAN vs. WAN
Parameters LAN WAN
Expands to Local Area Network Wide Area Network
Meaning LAN is used to connect computers WAN is used to connect computers
in a single office, building or in a large geographical area such
campus as countries
Ownership of network Private Private or public
1-18
DATA COMMUNICATION
1.3.4 Switching
• An internet is a switched network in which a switch connects at least two links together.
• A switch needs to forward data from a network to another network when required.
• Two types of switched networks are 1) circuit-switched and 2) packet-switched networks.
1.3.4.1 Circuit Switched Network
A dedicated connection, called a circuit, is always available between the two end systems.
The switch can only make it active or inactive.
¤ As shown in Figure 1.13, the 4 telephones at each side are connected to a switch.
¤ The switch connects a telephone at one side to a telephone at the other side.
¤ A high-capacity line can handle 4 voice communications at the same time.
¤ The capacity of high line can be shared between all pairs of telephones.
¤ The switch is used for only forwarding.
Advantage:
A circuit-switched network is efficient only when it is working at its full capacity.
Disadvantage:
Most of the time, the network is inefficient because it is working at partial capacity.
1.3.4.2 Packet Switched Network
In a computer network, the communication between the 2 ends is done in blocks of data
called packets.
The switch is used for both storing and forwarding because a packet is an independent entity
that can be stored and sent later.
¤ As shown in Figure 1.14, the 4 computers at each side are connected to a router.
¤ A router has a queue that can store and forward the packet.
¤ The high-capacity line has twice the capacity of the low-capacity line.
¤ If only 2 computers (one at each site) need to communicate with each other, there is
no waiting for the packets.
¤ However, if packets arrive at one router when high-capacity line is at its full capacity,
the packets should be stored and forwarded.
Advantages:
A packet-switched network is more efficient than a circuit switched network.
Disadvantage:
The packets may encounter some delays.
1-19
DATA COMMUNICATION
1.3.5 The Internet Today
• A network of networks is called an internet. (Internet inter-network)
• Internet is made up of (Figure 1.15)
1) Backbones
2) Provider networks &
3) Customer networks
1) Backbones
Backbones are large networks owned by communication companies such as BSNL and Airtel.
The backbone networks are connected through switching systems, called peering points.
2) Provider Networks
Provider networks use the services of the backbones for a fee.
Provider networks are connected to backbones and sometimes to other provider networks.
3) Customer Networks
Customer networks actually use the services provided by the Internet.
Customer networks pay fees to provider networks for receiving services.
• Backbones and provider networks are also called Internet Service Providers (ISPs).
• The backbones are often referred to as international ISPs.
The provider networks are often referred to as national or regional ISPs.
1-20
DATA COMMUNICATION
1.4.1 Scenarios
First Scenario
• In the first scenario, communication is so simple that it can occur in only one layer (Figure 2.1).
• Assume Maria and Ann are neighbors with a lot of common ideas.
• Communication between Maria and Ann takes place in one layer, face to face, in the same language
Second Scenario
• Maria and Ann communicate using regular mail through the post office (Figure 2.2).
• However, they do not want their ideas to be revealed by other people if the letters are intercepted.
• They agree on an encryption/decryption technique.
• The sender of the letter encrypts it to make it unreadable by an intruder; the receiver of the letter
decrypts it to get the original letter.
1-21
DATA COMMUNICATION
1.4.1.1 Protocol Layering
• Protocol layering enables us to divide a complex task into several smaller and simpler tasks.
• Modularity means independent layers.
• A layer (module) can be defined as a black box with inputs and outputs, without concern about how
inputs are changed to outputs.
• If two machines provide the same outputs when given the same inputs, they can replace each other.
• Advantages:
1) It allows us to separate the services from the implementation.
2) There are intermediate systems that need only some layers, but not all layers.
• Disadvantage:
1) Having a single layer makes the job easier. There is no need for each layer to provide a
service to the upper layer and give service to the lower layer.
1-22
DATA COMMUNICATION
1.5 TCP/IP PROTOCOL SUITE
• TCP/IP is a protocol-suite used in the Internet today.
• Protocol-suite refers a set of protocols organized in different layers.
• It is a hierarchical protocol made up of interactive modules, each of which provides a specific
functionality.
• The term hierarchical means that each upper level protocol is supported by the services provided by
one or more lower level protocols.
1-23
DATA COMMUNICATION
1.5.2 Layers in the TCP/IP Protocol Suite
• As shown in the figure 2.6, the duty of the application, transport, and network layers is end-to-end.
• However, the duty of the data-link and physical layers is hop-to-hop. A hop is a host or router.
• The domain of duty of the top three layers is the internet.
The domain of duty of the two lower layers is the link.
• In top 3 layers, the data unit should not be changed by any router or link-layer switch.
In bottom 2 layers, the data unit is changed only by the routers, not by the link-layer switches.
• Identical objects exist between two hops. Because router may fragment the packet at the network
layer and send more packets than received (Figure 2.7).
• The link between two hops does not change the object.
1-24
DATA COMMUNICATION
1.5.3 Description of Each Layer
Physical Layer
• The physical layer is responsible for movements of individual bits from one node to another node.
• Transmission media is another hidden layer under the physical layer.
• Two devices are connected by a transmission medium (cable or air).
• The transmission medium does not carry bits; it carries electrical or optical signals.
• The physical layer
→ receives bits from the data-link layer &
→ sends through the transmission media.
Data Link Layer
• Data-link-layer (DLL) is responsible for moving frames from one node to another node over a link.
• The link can be wired LAN/WAN or wireless LAN/WAN.
• The data-link layer
→ gets the datagram from network layer
→ encapsulates the datagram in a packet called a frame.
→ sends the frame to physical layer.
• TCP/IP model does not define any specific protocol.
• DLL supports all the standard and proprietary protocols.
• Each protocol may provide a different service.
• Some protocols provide complete error detection and correction; some protocols provide only error
correction.
Network Layer
• The network layer is responsible for source-to-destination transmission of data.
• The network layer is also responsible for routing the packet.
• The routers choose the best route for each packet.
• Why we need the separate network layer?
1) The separation of different tasks between different layers.
2) The routers do not need the application and transport layers.
• TCP/IP model defines 5 protocols:
1) IP (Internetworking Protocol) 2) ARP (Address Resolution Protocol)
3) ICMP (Internet Control Message Protocol) 4) IGMP (Internet Group Message Protocol)
1) IP
IP is the main protocol of the network layer.
IP defines the format and the structure of addresses.
IP is also responsible for routing a packet from its source to its destination.
It is a connection-less & unreliable protocol.
i) Connection-less means there is no connection setup b/w the sender and the receiver.
ii) Unreliable protocol means
→ IP does not make any guarantee about delivery of the data.
→ Packets may get dropped during transmission.
It provides a best-effort delivery service.
Best effort means IP does its best to get the packet to its destination, but with no guarantees.
IP does not provide following services
→ flow control
→ error control
→ congestion control services.
If an application requires above services, the application should rely only on the transport-
layer protocol.
2) ARP
ARP is used to find the physical-address of the node when its Internet-address is known.
Physical address is the 48-bit address that is imprinted on the NIC or LAN card.
Internet address (IP address) is used to uniquely & universally identify a device in the
internet.
3) ICMP
ICMP is used to inform the sender about datagram-problems that occur during transit.
4) IGMP
IGMP is used to send the same message to a group of recipients.
1-25
DATA COMMUNICATION
Transport Layer
• TL protocols are responsible for delivery of a message from a process to another process.
• The transport layer
→ gets the message from the application layer
→ encapsulates the message in a packet called a segment and
→ sends the segment to network layer.
• TCP/IP model defines 3 protocols:1) TCP (Transmission Control Protocol)
2) UDP (User Datagram Protocol) &
3) SCTP (Stream Control Transmission Protocol)
1) TCP
TCP is a reliable connection-oriented protocol.
A connection is established b/w the sender and receiver before the data can be transmitted.
TCP provides
→ flow control
→ error control and
→ congestion control
2) UDP
UDP is the simplest of the 3 transport protocols.
It is an unreliable, connectionless protocol.
It does not provide flow, error, or congestion control.
Each datagram is transported separately & independently.
It is suitable for application program that
→ needs to send short messages &
→ cannot afford the retransmission.
3) SCTP
SCTP provides support for newer applications such as voice over the Internet.
It combines the best features of UDP and TCP.
Application Layer
• The two application layers exchange messages between each other.
• Communication at the application layer is between two processes (two programs running at this
layer).
• To communicate, a process sends a request to the other process and receives a response.
• Process-to-process communication is the duty of the application layer.
• TCP/IP model defines following protocols:
1) SMTP is used to transport email between a source and destination.
2) TELNET is used for accessing a site remotely.
3) FTP is used for transferring files from one host to another.
4) DNS is used to find the IP address of a computer.
5) SNMP is used to manage the Internet at global and local levels.
6) HTTP is used for accessing the World Wide Web (WWW).
1-26
DATA COMMUNICATION
1.5.4 Encapsulation and Decapsulation
1-27
DATA COMMUNICATION
C) Decapsulation at the Destination Host
• At the destination host, each layer
→ decapsulates the packet received from lower layer
→ removes the payload and
→ delivers the payload to the next-higher layer
1.5.5 Addressing
• We have logical communication between pairs of layers.
• Any communication that involves 2 parties needs 2 addresses: source address and destination
address.
• We need 4 pairs of addresses (Figure 2.9):
1) At the application layer, we normally use names to define
→ site that provides services, such as bitm.edu.in, or
→ e-mail address, such as forouzan@gmail.com.
2) At the transport layer, addresses are called port numbers.
Port numbers define the application-layer programs at the source and destination.
Port numbers are local addresses that distinguish between several programs running at the
same time.
3) At the network-layer, addresses are called IP addresses.
IP address uniquely defines the connection of a device to the Internet.
The IP addresses are global, with the whole Internet as the scope.
4) At the data link-layer, addresses are called MAC addresses
The MAC addresses defines a specific host or router in a network (LAN or WAN).
The MAC addresses are locally defined addresses.
1-28
DATA COMMUNICATION
1.6 OSI MODEL
• OSI model was developed by ISO.
• ISO is the organization, OSI is the model.
• Purpose: OSI was developed to allow systems with diff. platforms to communicate with each other.
• Platform means hardware, software or operating system.
• OSI is a network-model that defines the protocols for network communications.
• OSI has 7 layers as follows (Figure 2.11):
1) Application Layer
2) Presentation Layer
3) Session Layer
4) Transport Layer
5) Network Layer
6) Data Link Layer
7) Physical Layer
• Each layer has specific duties to perform and has to co-operate with the layers above & below it.
1-29
DATA COMMUNICATION
1-30
DATA COMMUNICATION
1.8 DIGITAL SIGNALS
• Information can be represented by a digital signal.
• For example:
1) 1 can be encoded as a positive voltage.
0 can be encoded as a zero voltage (Figure 3.17a).
2) A digital signal can have more than 2 levels (Figure 3.17b).
Example 1.1
Example 1.2
Example 1.3
1-31
DATA COMMUNICATION
Example 1.4
1-32
DATA COMMUNICATION
1.8.4 Transmission of Digital Signals
• Two methods for transmitting a digital signal:
1) Baseband transmission 2) Broadband transmission (using modulation).
1-33
DATA COMMUNICATION
Case 2: Low-Pass Channel with Limited Bandwidth
In a low-pass channel with limited bandwidth, we approximate the digital signal with an
analog signal.
The level of approximation depends on the bandwidth available.
A) Rough Approximation
¤ Assume that we have a digital signal of bit rate N (Figure 3.22).
¤ If we want to send analog signals to roughly simulate this signal, we need to consider
the worst case, a maximum number of changes in the digital signal.
¤ This happens when the signal carries the sequence 01010101 . . or 10101010. . . .
¤ To simulate these two cases, we need an analog signal of frequency f = N/2.
¤ Let 1 be the positive peak value and 0 be the negative peak value.
¤ We send 2 bits in each cycle; the frequency of the analog signal is one-half of the bit
rate, or N/2.
¤ This rough approximation is referred to as using the first harmonic (N/2) frequency.
The required bandwidth is
B) Better Approximation
¤ To make the shape of the analog signal look more like that of a digital signal, we need
to add more harmonics of the frequencies (Figure 3.23).
¤ We can increase the bandwidth to 3N/2, 5N/2, 7N/2, and so on.
¤ In baseband transmission, the required bandwidth is proportional to the bit rate;
If we need to send bits faster, we need more bandwidth.
1-34
DATA COMMUNICATION
Example 1.5
Example 1.6
1-35
DATA COMMUNICATION
1.8.4.2 Broadband Transmission (Using Modulation)
• Broadband transmission or modulation means changing the digital signal to an analog signal for
transmission.
• Modulation allows us to use a bandpass channel (Figure 3.24).
• Bandpass channel means a channel with a bandwidth that does not start from zero.
• This type of channel is more available than a low-pass channel.
1-36
DATA COMMUNICATION
1.9 TRANSMISSION IMPAIRMENT
• Signals travel through transmission media, which are not perfect.
• The imperfection causes signal-impairment.
• This means that signal at beginning of the medium is not the same as the signal at end of medium.
• What is sent is not what is received.
• Three causes of impairment are (Figure 3.26):
1) Attenuation
2) Distortion &
3) Noise.
1.9.1 Attenuation
• As signal travels through the medium, its strength decreases as distance increases. This is called
attenuation (Figure 3.27).
• As the distance increases, attenuation also increases.
• For example:
Voice-data becomes weak over the distance & loses its contents beyond a certain distance.
• To compensate for this loss, amplifiers are used to amplify the signal.
1.9.1.1 Decibel
• The decibel (dB) measures the relative strengths of
→ 2 signals or
→ one signal at 2 different points.
• The decibel is negative if a signal is attenuated.
The decibel is positive if a signal is amplified.
Example 1.7
1-37
DATA COMMUNICATION
Example 1.8
Example 1.9
Example 1.10
1.9.2 Distortion
• Distortion means that the signal changes its form or shape (Figure 3.29).
• Distortion can occur in a composite signal made of different frequencies.
• Different signal-components
→ have different propagation speed through a medium.
→ have different delays in arriving at the final destination.
• Differences in delay create a difference in phase if delay is not same as the period-duration.
• Signal-components at the receiver have phases different from what they had at the sender.
• The shape of the composite signal is therefore not the same.
1-38
DATA COMMUNICATION
1.9.3 Noise
• Noise is defined as an unwanted data (Figure 3.30).
• In other words, noise is the external energy that corrupts a signal.
• Due to noise, it is difficult to retrieve the original data/information.
• Four types of noise:
i) Thermal Noise
It is random motion of electrons in wire which creates extra signal not originally sent by
transmitter.
ii) Induced Noise
Induced noise comes from sources such as motors & appliances.
These devices act as a sending-antenna.
The transmission-medium acts as the receiving-antenna.
iii) Crosstalk
Crosstalk is the effect of one wire on the other.
One wire acts as a sending-antenna and the other as the receiving-antenna.
iv) Impulse Noise
Impulse Noise is a spike that comes from power-lines, lightning, and so on.
(spike a signal with high energy in a very short time)
• SNR is actually the ratio of what is wanted (signal) to what is not wanted (noise).
• A high-SNR means the signal is less corrupted by noise.
A low-SNR means the signal is more corrupted by noise.
• Because SNR is the ratio of 2 powers, it is often described in decibel units, SNRdB, defined as
Example 1.11
1-39
DATA COMMUNICATION
1.10 DATA RATE LIMITS
• Data-rate depends on 3 factors:
1) Bandwidth available
2) Level of the signals
3) Quality of channel (the level of noise)
• Two theoretical formulas can be used to calculate the data-rate:
1) Nyquist for a noiseless channel and
2) Shannon for a noisy channel.
Example 1.12
Example 1.13
Example 1.14
1-40
DATA COMMUNICATION
1.10.2 Noisy Channel: Shannon Capacity
In reality, we cannot have a noiseless channel; the channel is always noisy.
For a noisy channel, the Shannon capacity formula defines the theoretical maximum bit-rate.
Example 1.15
Example 1.16
Example 1.17
1-41
DATA COMMUNICATION
1.11 PERFORMANCE
1.11.1 Bandwidth
• One characteristic that measures network-performance is bandwidth.
• Bandwidth of analog and digital signals is calculated in separate ways:
(1) Bandwidth of an Analog Signal (in hz)
Bandwidth of an analog signal is expressed in terms of its frequencies.
Bandwidth is defined as the range of frequencies that the channel can carry.
It is calculated by the difference b/w the maximum frequency and the minimum frequency.
In figure 3.13, the signal has a minimum frequency of F1 = 1000Hz and maximum
frequency of F2 = 5000Hz.
Hence, the bandwidth is given by F2 – F1= 5000 - 1000 = 4000 Hz
(2) Bandwidth of a Digital Signal (in bps)
Bandwidth refers to the number of bits transmitted in one second in a channel (or link).
For example:
The bandwidth of a Fast Ethernet is a maximum of 100 Mbps. (This means that this
network can send 100 Mbps).
Relationship between (1) and (2)
• There is an explicit relationship between the bandwidth in hertz and bandwidth in bits per seconds.
• Basically, an increase in bandwidth in hertz means an increase in bandwidth in bits per second.
• The relationship depends on
→ baseband transmission or
→ transmission with modulation.
1-42
DATA COMMUNICATION
1.11.2 Throughput
• The throughput is a measure of how fast we can actually send data through a network.
• Although, bandwidth in bits per second and throughput seem the same, they are actually different.
• A link may have a bandwidth of B bps, but we can only send T bps through this link with T always
less than B.
• In other words,
1) The bandwidth is a potential measurement of a link.
2) The throughput is an actual measurement of how fast we can send data.
For example:
¤ We may have a link with a bandwidth of 1 Mbps, but the devices connected to
the end of the link may handle only 200 kbps.
¤ This means that we cannot send more than 200 kbps through this link.
Example 1.18
1-43
DATA COMMUNICATION
1.11.3 Latency (Delay)
• The latency defines how long it takes for an entire message to completely arrive at the destination
from the time the first bit is sent out from the source.
1) Propagation Time
Propagation time is defined as the time required for a bit to travel from source to destination.
Propagation time is given by
Example 1.19
2) Transmission Time
The time required for transmission of a message depends on
→ size of the message and
→ bandwidth of the channel.
The transmission time is given by
Example 1.20
c
Example 1.21
1-44
DATA COMMUNICATION
3) Queuing Time
Queuing-time is the time needed for each intermediate-device to hold the message before it
can be processed.
(Intermediate device may be a router or a switch)
The queuing-time is not a fixed factor. This is because
i) Queuing-time changes with the load imposed on the network.
ii) When there is heavy traffic on the network, the queuing-time increases.
An intermediate-device
→ queues the arrived messages and
→ processes the messages one by one.
If there are many messages, each message will have to wait.
4) Processing Delay
Processing delay is the time taken by the routers to process the packet header.
1-45
DATA COMMUNICATION
1.11.4 Bandwidth Delay Product
• Two performance-metrics of a link are 1) Bandwidth and 2) Delay
• The bandwidth-delay product is very important in data-communications.
• Let us elaborate on this issue, using 2 hypothetical cases as examples.
Case 1: The following figure shows case 1 (Figure 3.32).
Let us assume,
Bandwidth of the link = 1 bps Delay of the link = 5s.
From the figure 3.32, bandwidth-delay product is 1 x 5 = 5. Thus, there can be maximum 5
bits on the line.
There can be no more than 5 bits at any time on the link.
Case 2: The following figure shows case 2 (Figure 3.33).
Let us assume,
Bandwidth of the link = 4 bps Delay of the link = 5s.
From the figure 3.33, bandwidth-delay product is 5 x 5 = 25. Thus, there can be maximum
25 bits on the line.
At each second, there are 5 bits on the line, thus the duration of each bit is 0.20s.
• The above 2 cases show that the (bandwidth X delay) is the number of bits that can fill the link.
• This measurement is important if we need to
→ send data in bursts and
→ wait for the acknowledgment of each burst.
• To use the maximum capability of the link
→ We need to make the burst-size as (2 x bandwidth x delay).
→ We need to fill up the full-duplex channel (two directions).
• Amount (2x bandwidth x delay) is the number of bits that can be in transition at any time (Fig 3.34).
1-46
DATA COMMUNICATION
1.11.5 Jitter
• Another performance issue that is related to delay is jitter.
• We can say that jitter is a problem
→ if different packets of data encounter different delays and
→ if the application using the data at the receiver site is time-sensitive (for ex: audio/video).
• For example:
If the delay for the first packet is 20 ms
the delay for the second is 45 ms and
the delay for the third is 40 ms
then the real-time application that uses the packets suffers from jitter.
1-47
DATA COMMUNICATION
1-48
DATA COMMUNICATION
1.12.1.1 Characteristics
• Different characteristics of digital signal are
1) Signal Element Vs Data Element
2) Data Rate Vs Signal Rate
3) Bandwidth
4) Baseline Wandering
5) DC Components
6) Built-in Error Detection
7) Self-synchronization
8) Immunity to Noise and Interference
9) Complexity
1-49
DATA COMMUNICATION
3) Bandwidth
Digital signal that carries information is non-periodic.
The bandwidth of a non-periodic signal is continuous with an infinite range.
However, most digital-signals we encounter in real life have a bandwidth with finite values.
The effective bandwidth is finite.
The baud rate, not the bit-rate, determines the required bandwidth for a digital-signal.
More changes in the signal mean injecting more frequencies into the signal.
(Frequency means change and change means frequency.)
The bandwidth refers to range of frequencies used for transmitting a signal.
Relationship b/w baud rate (signal-rate) and the bandwidth (range of frequencies) is given as
As shown in figure 4.3, we have a situation where the receiver has shorter bit duration.
The sender sends 10110001, while the receiver receives 110111000011.
A self-synchronizing digital-signal includes timing-information in the data being transmitted.
¤ This can be achieved if there are transitions in the signal that alert the receiver to the
beginning, middle, or end of the pulse.
¤ If the receiver’s clock is out-of-synchronization, these points can reset the clock.
1-50
DATA COMMUNICATION
8) Immunity to Noise & Interference
The code should be immune to noise and other interferences.
9) Complexity
A complex scheme is more costly to implement than a simple one.
For ex: A scheme that uses 4 signal-levels is more difficult to interpret than one that uses
only 2 levels.
Example 1.22
Example 1.23
1-51
DATA COMMUNICATION
1.12.2 LINE CODING SCHEMES
• The Line Coding schemes are classified into 3 broad categories (Figure 4.4):
Disadvantages:
1) Compared to polar scheme, this scheme is very costly.
2) Also, the normalized power is double that for polar NRZ.
3) Not suitable for transmission over channels with poor performance around zero frequency.
(Normalized power power needed to send 1 bit per unit line resistance)
1-52
DATA COMMUNICATION
1.12.2.2 Polar Schemes
• The voltages are on the both sides of the time axis.
• Polar NRZ scheme can be implemented with two voltages (V).
For example: -V for bit 1
+V for bit 0.
a) Non-Return-to-Zero (NRZ)
We use 2 levels of voltage amplitude.
Two versions of polar NRZ (Figure 4.6):
i) NRZ-L (NRZ-Level)
¤ The level of the voltage determines the value of the bit.
¤ For example: i) Voltage-level for 0 can be positive and
ii) Voltage-level for 1 can be negative.
ii) NRZ-I (NRZ-Invert)
¤ The change or lack of change in the level of the voltage determines the value of the
bit.
¤ If there is no change, the bit is 0;
If there is a change, the bit is 1.
Disadvantages:
1) Baseline wandering is a problem for both variations (NRZ-L NRZ-I).
i) In NRZ-L, if there is a long sequence of 0s or 1s, the average signal-power
becomes skewed.
The receiver might have difficulty discerning the bit value.
ii) In NRZ-I, this problem occurs only for a long sequence of 0s.
If we eliminate the long sequence of 0s, we can avoid baseline wandering.
2) The synchronization problem also exists in both schemes.
→ A long sequence of 0s can cause a problem in both schemes.
→ A long sequence of 1s can cause a problem in only NRZ-L.
3) In NRZ-L, problem occurs when there is a sudden change of polarity in the system.
¤ For example:
In twisted-pair cable, a change in the polarity of the wire results in
→ all 0s interpreted as 1s and
→ all 1s interpreted as 0s.
¤ NRZ-I does not have this problem.
¤ Both schemes have an average signal-rate of N/2 Bd.
4) NRZ-L and NRZ-I both have a DC component problem.
Example 1.24
1-53
DATA COMMUNICATION
b) Return-to-Zero (RZ)
In NRZ encoding, problem occurs when the sender-clock and receiver-clock are not
synchronized.
Solution: Use return-to-zero (RZ) scheme (Figure 4.7).
RZ scheme uses 3 voltages: positive, negative, and zero.
There is always a transition at the middle of the bit. Either
i) from high to zero (for 1) or
ii) from low to zero (for 0)
Disadvantages:
1) RZ encoding requires 2 signal-changes to encode a bit & .’. occupies greater bandwidth.
2) Complexity: RZ uses 3 levels of voltage, which is more complex to create and detect.
3) Problem occurs when there is a sudden change of polarity in the system. This result in
→ all 0s interpreted as 1s &
→ all 1s interpreted as 0s.
1-54
DATA COMMUNICATION
c) Biphase: Manchester & Differential Manchester
i) Manchester Encoding
This is a combination of NRZ-L & RZ schemes (RZtransition at the middle of the bit).
There is always a transition at the middle of the bit. Either
i) from high to low (for 0) or
ii) from low to high (for 1).
It uses only two voltage levels (Figure 4.8).
The duration of the bit is divided into 2 halves.
The voltage
→ remains at one level during the first half &
→ moves to the other level in the second half.
The transition at the middle of the bit provides synchronization.
ii) Differential Manchester
This is a combination of NRZ-I and RZ schemes.
There is always a transition at the middle of the bit, but the bit-values are determined at the
beginning of the bit.
If the next bit is 0, there is a transition. If the next bit is 1, there is none.
Advantages:
1) The Manchester scheme overcomes problems associated with NRZ-L.
Differential Manchester overcomes problems associated with NRZ-I.
2) There is no baseline wandering.
3) There is no DC component ‘.’ each bit has a positive & negative voltage contribution.
Disadvantage:
1) Signal-rate: Signal-rate for Manchester & diff. Manchester is double that for NRZ.
1-55
DATA COMMUNICATION
1.12.2.3 Bipolar Schemes (or Multilevel Binary)
• This coding scheme uses 3 voltage levels (Figure 4.9):
i) positive
ii) negative &
iii) zero.
• Two variations of bipolar encoding:
i) AMI (Alternate Mark Inversion)
ii) Pseudoternary
i) AMI
Binary 0 is represented by a neutral 0 voltage (AMI Alternate 1 Inversion).
Binary 1s are represented by alternating positive and negative voltages.
ii) Pseudoternary
Binary 1 is represented by a neutral 0 voltage.
Binary 0s are represented by alternating positive and negative voltages.
Advantages:
1) The bipolar scheme has the same signal-rate as NRZ.
2) There is no DC component ‘.’ each bit has a positive & negative voltage contribution.
3) The concentration of the energy is around frequency N/2.
Disadvantage:
1) AMI has a synchronization problem when a long sequence of 0s is present in the data.
1-56
DATA COMMUNICATION
QUESTIONS
MODULE 1: INTRODUCTION
1-57
DATA COMMUNICATION
10) Define digital to analog conversion? List different types of digital to analog conversion. (2)
11) Describe ASK, FSK and PSK mechanisms and apply them over the digital data 101101. (4)
12) Discuss the bandwidth requirement for ASK, FSK and PSK. (4*)
13) Explain different aspects of digital-to-analog conversion? (6*)
14) Define ASK. Explain BASK. (6*)
15) Define FSK. Explain BFSK. (6*)
16) Define PSK. Explain BPSK. (6*)
17) Explain QPSK. (6)
18) Explain the concept of constellation diagram. (6)
10)Explain QAM. (6)
1-58
DATA COMMUNICATION
2.1.1 PCM
• PCM is a technique used to change an analog signal to digital data (digitization).
• PCM has encoder at the sender and decoder at the receiver.
• The encoder has 3 processes (Figure 4.21):
1) Sampling
2) Quantization &
3) Encoding.
2.1.1.1 Sampling
• We convert the continuous time signal (analog) into the discrete time signal (digital).
• Pulses from the analog-signal are sampled every Ts sec
where Ts is the sample-interval or period.
• The inverse of the sampling-interval is called the sampling-frequency (or sampling-rate).
• Sampling-frequency is given by
2-59
DATA COMMUNICATION
2.1.1.1.1 Sampling Rate
• According to Nyquist theorem,
“The sampling-rate must be at least 2 times the highest frequency, not the bandwidth“.
i) If the analog-signal is low-pass, the bandwidth and the highest frequency are the
same value (Figure 4.23a).
ii) If the analog-signal is bandpass, the bandwidth value is lower than the value of the
maximum frequency (Figure 4.23b).
2.1.2 Quantization
• The sampled-signal is quantized.
• Result of sampling is a set of pulses with amplitude-values b/w max & min amplitudes of the signal.
• Four steps in quantization:
1) We assume that the original analog-signal has amplitudes between Vmin & Vmax.
2) We divide the range into L zones, each of height Δ(delta).
2-60
DATA COMMUNICATION
2.1.2.1 Quantization Level
• Let L = number of levels.
• The choice of L depends on
→ range of the amplitudes of the analog-signal and
→ how accurately we need to recover the signal.
• If the signal has only 2 amplitude values, we need only 2 quantization-levels.
If the signal (like voice) has many amplitude values, we need more quantization-levels.
• In audio digitizing, L is normally chosen to be 256.
In video digitizing, L is normally thousands.
• Choosing lower values of L increases the quantization-error.
2.1.3 Encoding
• The quantized values are encoded as n-bit code word.
• In the previous example,
A quantized value 2 is encoded as 010.
A quantized value 5 is encoded as 101.
• Relationship between number of quantization-levels (L) & number of bits (n) is given by
n=log2L or 2n=L
• The bit-rate is given by:
Example 2.1
Example 2.2
2-61
DATA COMMUNICATION
Example 2.3
Example 2.4
• When 1/r = 1 (for a NRZ or bipolar signal) and c = (1/2) (the average situation), the minimum
bandwidth is
• This means the minimum bandwidth of the digital-signal is nb times greater than the bandwidth of
the analog-signal.
2-62
DATA COMMUNICATION
2.1.3.3 Maximum Data Rate of a Channel
• The Nyquist theorem gives the data-rate of a channel as
• We can deduce above data-rate from the Nyquist sampling theorem by using the following
arguments.
1) We assume that the available channel is low-pass with bandwidth B.
2) We assume that the digital-signal we want to send has L levels, where each level is a signal-
element. This means r = 1/log2L.
3) We first pass digital-signal through a low-pass filter to cut off the frequencies above B Hz.
4) We treat the resulting signal as an analog-signal and sample it at 2 x B samples per second
and quantize it using L levels.
5) The resulting bit-rate is
This is the maximum bandwidth; if the case factor c increases, the data-rate is reduced.
2-63
DATA COMMUNICATION
2.2 TRANSMISSION MODES
• Two ways of transmitting data over a link (Figure 4.31): 1) Parallel mode & 2) Serial mode.
• Advantage:
1) Speed: Parallel transmission can increase the transfer speed by a factor of n over serial
transmission.
• Disadvantage:
1) Cost: Parallel transmission requires n communication lines just to transmit the data-stream.
Because this is expensive, parallel transmission is usually limited to short distances.
• Advantage:
1) Cost: Serial transmission reduces cost of transmission over parallel by a factor of n.
• Disadvantage:
1) Since communication within devices is parallel, following 2 converters are required at interface:
i) Parallel-to-serial converter
ii) Serial-to-parallel converter
• Three types of serial transmission: asynchronous, synchronous, and isochronous.
2-64
DATA COMMUNICATION
2.2.2.1 Asynchronous Transmission
• Asynchronous transmission is so named because the timing of a signal is not important (Figure 4.34).
• Prior to data transfer, both sender & receiver agree on pattern of information to be exchanged.
• Normally, patterns are based on grouping the bit-stream into bytes.
• The sender transmits each group to the link without regard to a timer.
• As long as those patterns are followed, the receiver can retrieve the info. without regard to a timer.
• There may be a gap between bytes.
• We send
→ 1 start bit (0) at the beginning of each byte
→ 1 stop bit (1) at the end of each byte.
• Start bit alerts the receiver to the arrival of a new group.
Stop bit lets the receiver know that the byte is finished.
• Here, the term asynchronous means “asynchronous at the byte level”.
However, the bits are still synchronized & bit-durations are the same.
• Disadvantage:
1) Slower than synchronous transmission. (Because of stop bit, start bit and gaps)
• Advantages:
1) Cheap & effective.
2) Useful for low-speed communication.
• Advantages:
1) Speed: Faster than asynchronous transmission. („.‟ of no stop bit, start bit and gaps).
2) Useful for high-speed applications such as transmission of data from one computer to another.
2.2.2.3 Isochronous
• Synchronization between characters is not enough; the entire stream of bits must be synchronized.
• The isochronous transmission guarantees that the data arrive at a fixed rate.
• In real-time audio/video, jitter is not acceptable. Therefore, synchronous transmission fails.
• For example: TV images are broadcast at the rate of 30 images per second. The images must be
viewed at the same rate.
2-65
DATA COMMUNICATION
2-66
DATA COMMUNICATION
2.3.1 Aspects of Digital-to-Analog Conversion
1) Data Element vs. Signal Element
A data-element is the smallest piece of information to be exchanged i.e. the bit.
A signal-element is the smallest unit of a signal that is transmitted.
2) Data Rate vs. Signal Rate
Data rate (Bit rate) is the number of bits per second.
Signal-rate (Baud rate) is the number of signal elements per second.
The relationship between data-rate(N) and the signal-rate(S) is
Example 2.5
Example 2.6
2-67
DATA COMMUNICATION
2.3.2 Amplitude Shift Keying (ASK)
• The amplitude of the carrier-signal is varied to represent different signal-elements.
• Both frequency and phase remain constant for all signal-elements.
2.3.2.1 Binary ASK (BASK)
• BASK is implemented using only 2 levels. (Figure 5.3)
• This is also referred to as OOK (On-Off Keying).
2-68
DATA COMMUNICATION
2.3.3 Frequency Shift Keying (FSK)
• The frequency of the carrier-signal is varied to represent different signal-elements.
• The frequency of the modulated-signal is constant for the duration of one signal-element, but
changes for the next signal-element if the data-element changes.
• Both amplitude and phase remain constant for all signal-elements.
2.3.3.1.1 Implementation
• Here, line coding method used = unipolar NRZ.
• Two implementations of BFSK: i) Coherent and ii) Non-Coherent.
Coherent BFSK Non Coherent BFSK
The phase continues through the boundary of There may be discontinuity in the phase when
two signal-elements (Figure 5.7). one signal-element ends and the next begins.
This is implemented by using one voltage- This is implemented by
controlled oscillator (VCO). → treating BFSK as 2 ASK modulations and
VCO changes frequency according to the input → using 2 carrier-frequencies
voltage.
When the amplitude of NRZ signal = 0, the VCO
keeps its regular frequency.
When the amplitude of NRZ signal = 0, the VCO
increases its frequency.
2-69
DATA COMMUNICATION
Example 2.9
2-70
DATA COMMUNICATION
2.3.4 Phase Shift Keying (PSK)
• The phase of the carrier-signal is varied to represent different signal-elements.
• Both amplitude and frequency remain constant for all signal-elements.
2.3.4.1.1 Implementation
• The implementation of BPSK is as simple as that for ASK. (Figure 5.10).
• The signal-element with phase 180° can be seen as the complement of the signal-element with
phase 0°.
• Here, line coding method used: polar NRZ.
• The polar NRZ signal is multiplied by the carrier-frequency coming from an oscillator.
1) When data-element = 1, the phase starts at 0°.
2) When data-element = 0, the phase starts at 180°.
2-71
DATA COMMUNICATION
2.3.4.2 Quadrature PSK (QPSK)
• The scheme is called QPSK because it uses 2 separate BPSK modulations (Figure 5.11):
1) First modulation is in-phase,
2) Second modulation is quadrature (out-of-phase).
• A serial-to-parallel converter
→ accepts the incoming bits
→ sends first bit to first modulator and
→ sends second bit to second modulator.
• The bit to each BPSK signal has one-half the frequency of the original signal.
• Advantages:
1) Decreases the baud rate.
2) Decreases the required bandwidth.
• As shown in Figure 5.11, the 2 composite-signals created by each multiplier are 2 sine waves with
the same frequency, but different phases.
• When the 2 sine waves are added, the result is another sine wave, with 4 possible phases: 45°, -45°,
135°, and -135°.
• There are 4 kinds of signal-elements in the output signal (L=4), so we can send 2 bits per signal-
element (r=2).
Example 2.10
2-72
DATA COMMUNICATION
2.3.4.3 Constellation Diagram
• A constellation diagram can be used to define the amplitude and phase of a signal-element.
• This diagram is particularly useful
→ when 2 carriers (one in-phase and one quadrature) are used.
→ when dealing with multilevel ASK, PSK, or QAM.
• In a constellation diagram, a signal-element type is represented as a dot.
• The diagram has 2 axes (Figure 5.12):
1) The horizontal X axis is related to the in-phase carrier.
2) The vertical Y axis is related to the quadrature carrier.
• For each point on the diagram, 4 pieces of information can be deduced.
1) The projection of point on the X axis defines the peak amplitude of the in-phase component.
2) The projection of point on Y axis defines peak amplitude of the quadrature component.
3) The length of the line that connects the point to the origin is the peak amplitude of the
signal-element (combination of the X and Y components);
4) The angle the line makes with the X axis is the phase of the signal-element.
Example 2.11
2-73
DATA COMMUNICATION
2.3.5 Quadrature Amplitude Modulation (QAM)
• This is a combination of ASK and PSK.
• Main idea: Using 2 carriers, one in-phase and the other quadrature, with different amplitude levels
for each carrier.
• There are many variations of QAM (Figure 5.14).
A) Figure 5.14a shows the 4-QAM scheme using a unipolar NRZ signal. This is same as BASK.
B) Figure 5.14b shows another QAM using polar NRZ. This is the same as QPSK.
C) Figure 5.14c shows another 4-QAM in which we used a signal with 2 positive levels to
modulate each of the 2 carriers.
D) Figure 5.14d shows a 16-QAM constellation of a signal with 8 levels, 4 positive & 4 negative.
2-74
DATA COMMUNICATION
3.1 INTRODUCTION
3.1.1 Types of Errors
3.1.2 Redundancy
3.1.3 Detection versus Correction
3.1.4 Coding
3.2 BLOCK CODING
3.2.1 Error Detection
3.2.1.1 Hamming Distance
3.2.1.1.1 Minimum Hamming Distance for Error Detection
3.2.1.2 Linear Block Codes
3.2.1.2.1 Minimum Distance for Linear Block Codes
3.2.1.3 Parity-Check Code
3.3 CYCLIC CODES
3.3.1 Cyclic Redundancy Check (CRC)
3.3.2 Polynomials
3.3.3 Cyclic Code Encoder Using Polynomials
3.3.4 Cyclic Code Analysis
3.3.5 Advantages of Cyclic Codes
3.4 CHECKSUM
3.4.1 Concept of Checksum
3.4.1.1 One's Complement
3.4.1.2 Internet Checksum
3.4.1.3 Algorithm
3.4.2 Other Approaches to the Checksum
3.4.2.1 Fletcher Checksum
3.4.2.2 Adler Checksum
3.5 FORWARD ERROR CORRECTION
3.5.1 Using Hamming Distance
3.5.2 Using XOR
3.5.3 Chunk Interleaving
3.5.4 Combining Hamming Distance and Interleaving
3.5.5 Compounding High- and Low-Resolution Packets
3.6 DLC SERVICES
3.6.1 Framing
3.6.1.1 Frame Size
3.6.1.2 Character-Oriented Framing
3.6.1.3 Bit-Oriented Framing
3.6.2 Flow and Error Control
3.6.2.1 Flow-control
3.6.2.1.1 Buffers
3.6.2.2 Error-control
3.6.2.2.1 Combination of Flow and Error Control
3.6.3 Connectionless and Connection-Oriented
3.7 DATA-LINK LAYER PROTOCOLS
3.7.1 Simple Protocol
3.7.1.1 Design
3.7.1.2 FSMs
3.7.2 Stop-and-Wait Protocol
3.7.2.1 Design
3.7.2.2 FSMs
3-75
DATA COMMUNICATION
3.7.2.3 Sequence and Acknowledgment Numbers
3.7.3 piggybacking
3.8 High-level Data Link Control (HDLC)
3.8.1 Configurations and Transfer Modes
3.8.2 Framing
3.8.2.1 Frame Format
3.8.2.1.1 Control Fields of HDLC Frames
3.9 POINT-TO-POINT PROTOCOL (PPP)
3.9.1 Framing
3.9.1.1 Byte Stuffing
3.9.2 Transition Phases
3.10 INTRODUCTION
3.11 RANDOM ACCESS PROTOCOL
3.11.1 ALOHA
3.11.1.1 Pure ALOHA
3.11.1.1.1 Vulnerable time
3.11.1.1.2 Throughput
3.11.1.2 Slotted ALOHA
3.11.1.2.1 Throughput
3.11.2 CSMA
3.11.2.1 Vulnerable Time
3.11.2.2 Persistence Methods
3.11.3 CSMA/CD
3.11.3.1 Minimum Frame-size
3.11.3.2 Procedure
3.11.3.3 Energy Level
3.11.3.4 Throughput
3.11.4 CSMA/CA
3.11.4.1 Frame Exchange Time Line
3.11.4.2 Network Allocation Vector
3.11.4.3 Collision During Handshaking
3.11.4.4 Hidden-Station Problem
3.11.4.5 CSMA/CA and Wireless Networks
3.12 CONTROLLED ACCESS PROTOCOL
3.12.1 Reservation
3.12.2 Polling
3.12.3 Token Passing
3.12.3.1 Logical Ring
3.13 CHANNELIZATION
3.13.1 FDMA
3.13.2 TDMA
3.13.3 CDMA
3.13.3.1 Implementation
3.13.3.2 Chips
3.13.3.3 Data Representation
3.13.3.4 Encoding and Decoding
Sequence Generation
3-76
DATA COMMUNICATION
QUESTIONS(MODULE 2)
MODULE 2: ERROR-DETECTION AND CORRECTION
3-77
DATA COMMUNICATION
MODULE 2: ERROR-DETECTION AND CORRECTION
3.1 INTRODUCTION
3.1.1 Types of Errors
• When bits flow from 1 point to another, they are subject to unpredictable-changes ‘.’ of interference.
• The interference can change the shape of the signal.
• Two types of errors: 1) Single-bit error 2) Burst-error.
1) Single-Bit Error
Only 1 bit of a given data is changed
→ from 1 to 0 or
→ from 0 to 1 (Figure 10.1a).
2) Burst Error
Two or more bits in the data have changed
→ from 1 to 0 or
→ from 0 to 1 (Figure 10.1b).
A burst-error occurs more than a single-bit error. This is because:
Normally, the duration of noise is longer than the duration of 1-bit.
When noise affects data, the noise also affects the bits.
The no. of corrupted-bits depends on
→ data-rate and
→ duration of noise.
3.1.2 Redundancy
• The central concept in detecting/correcting errors is redundancy.
• Some extra-bits along with the data have to be sent to detect/correct errors. These extra bits are
called redundant-bits.
• The redundant-bits are
→ added by the sender and
→ removed by the receiver.
• The presence of redundant-bits allows the receiver to detect/correct errors.
3-78
DATA COMMUNICATION
3.1.4 Coding
• Redundancy is achieved through various coding-schemes.
1) Sender adds redundant-bits to the data-bits. This process creates a relationship between
→ redundant-bits and
→ data-bits.
2) Receiver checks the relationship between redundant-bits & data-bits to detect/correct errors.
• Two important factors to be considered:
1) Ratio of redundant-bits to the data-bits and
2) Robustness of the process.
• Two broad categories of coding schemes: 1) Block-coding and 2) Convolution coding.
3-79
DATA COMMUNICATION
Example 3.1
¤ Let us assume that the sent code-word x is at the center of a circle with radius s.
¤ All received code-words that are created by 0 to s errors are points inside the circle or
on the perimeter of the circle.
¤ All other valid code-words must be outside the circle
• For example: A code scheme has a Hamming distance dmin = 4.
This code guarantees the detection of upto 3 errors (d = s + 1 or s = 3).
3-80
DATA COMMUNICATION
3.2.1.2 Linear Block Codes
• Almost all block codes belong to a subset of block codes called linear block codes.
• A linear block code is a code in which the XOR of 2 valid code-words creates another valid code-word.
(XOR Addition modulo-2)
• The code in Table 10.1 is a linear block code because the result of XORing any code-word with any
other code-word is a valid code-word.
For example, the XORing of the 2nd and 3rd code-words creates the 4th one.
3-81
DATA COMMUNICATION
3.2.1.3 Parity Check Code
• This code is a linear block code. This code can detect an odd number of errors.
• A k-bit data-word is changed to an n-bit code-word where n=k+1.
• One extra bit is called the parity-bit.
• The parity-bit is selected to make the total number of 1s in the code-word even.
• Minimum hamming distance dmin = 2. This means the code is a single-bit error-detecting code.
3-82
DATA COMMUNICATION
Example 3.2
3-83
DATA COMMUNICATION
3.3 Cyclic Codes
• Cyclic codes are special linear block codes with one extra property:
If a code-word is cyclically shifted (rotated), the result is another code-word.
For ex: if code-word = 1011000 and we cyclically left-shift, then another code-word = 0110001.
• Let First-word = a0 to a6 and Second-word = b0 to b6, we can shift the bits by using the following:
3-84
DATA COMMUNICATION
Example 3.3
3-85
DATA COMMUNICATION
3.3.2 Polynomials
• A pattern of 0s and 1s can be represented as a polynomial with coefficients of 0 and 1 (Figure 10.8).
• The power of each term shows the position of the bit; the coefficient shows the value of the bit.
3-86
DATA COMMUNICATION
Odd Numbers of Errors
• A generator that contains a factor of x+1 can detect all odd-numbered errors.
Standard Polynomials
3-87
DATA COMMUNICATION
3.4 Checksum
• Checksum is an error-detecting technique.
• In the Internet,
→ The checksum is mostly used at the network and transport layer.
→ The checksum is not used in the data link layer.
• Like linear and cyclic codes, the checksum is based on the concept of redundancy.
• Here is how it works (Figure 10.15):
1) At Source
Firstly the message is divided into m-bit units.
Then, the generator creates an extra m-bit unit called the checksum.
The checksum is sent with the message.
2) At Destination
The checker creates a new checksum from the combination of the message and sent-
checksum.
i) If the new checksum is all 0s, the message is accepted.
ii) If the new checksum is not all 0s, the message is discarded.
3-88
DATA COMMUNICATION
3.4.1 Concept of Checksum
Consider the following example:
Example 3.4
• Our data is a list of five 4-bit numbers that we want to send to a destination.
• In addition to sending these numbers, we send the sum of the numbers.
• For example:
Let set of numbers = (7, 11, 12, 0, 6).
We send (7, 11, 12, 0, 6, 36), where 36 is the sum of the original numbers.
• The receiver adds the five numbers and compares the result with the sum.
• If the result & the sum are the same,
The receiver assumes no error, accepts the five numbers, and discards the sum.
Otherwise, there is an error somewhere and the data are not accepted.
Example 3.5
• To make the job of the receiver easy if we send the negative (complement) of the sum, called the
checksum.
• In this case, we send (7, 11, 12, 0, 6, -36).
• The receiver can add all the numbers received (including the checksum).
• If the result is 0, it assumes no error; otherwise, there is an error.
3-89
DATA COMMUNICATION
3.4.1.2 Internet Checksum
• Traditionally, the Internet has been using a 16-bit checksum.
• The sender or the receiver uses five steps.
3.4.1.3 Algorithm
3-90
DATA COMMUNICATION
3.4.2 Other Approaches to the Checksum
• If two 16-bit items are transposed in transmission, the checksum cannot catch this error.
• The reason is that the traditional checksum is not weighted: it treats each data item equally.
• In other words, the order of data items is immaterial to the calculation.
• Two approaches have been used to prevent this problem: 1)Fletcher and 2)Adler
3-91
DATA COMMUNICATION
3.5 FORWARD ERROR CORRECTION
• Retransmission of corrupted and lost packets is not useful for real-time multimedia transmission
because it creates an unacceptable delay in reproducing: we need to wait until the lost or corrupted
packet is resent.
• We need to correct the error or reproduce the packet immediately.
• Several schemes have been designed and used that are collectively referred to as forward error
correction (FEC) techniques.
• We divide a packet into N chunks, create the exclusive OR of all the chunks and send N + 1 chunks.
• If any chunk is lost or corrupted, it can be created at the receiver site.
• If N = 4, it means that we need to send 25 percent extra data and be able to correct the data if only
one out of four chunks is lost.
• In Figure 10.21, each packet is divided into 5 chunks (normally the number is much larger).
• Then, we can create data chunk-by-chunk (horizontally), but combine the chunks into packets
vertically.
• In this case, each packet sent carries a chunk from several original packets.
• If the packet is lost, we miss only one chunk in each packet.
• Normally, missing of a chunk is acceptable in multimedia communication.
3-92
DATA COMMUNICATION
3.5.4 Combining Hamming Distance and Interleaving
• Hamming distance and interleaving can be combined.
• Firstly, we can create n-bit packets that can correct t-bit errors.
• Then, we interleave m rows and send the bits column-by-column.
• In this way, we can automatically correct burst-errors up to m×t bit errors.
3-93
DATA COMMUNICATION
3.6.1 Framing
• A frame is a group of bits.
• Framing means organizing the bits into a frame that are carried by the physical layer.
• The data-link-layer needs to form frames, so that each frame is distinguishable from another.
• Framing separates a message from other messages by adding sender-address & destination-address.
• The destination-address defines where the packet is to go.
The sender-address helps the recipient acknowledge the receipt.
• Q: Why the whole message is not packed in one frame?
Ans: Large frame makes flow and error-control very inefficient.
Even a single-bit error requires the re-transmission of the whole message.
When a message is divided into smaller frames, a single-bit error affects only that small frame.
(Our postal system practices a type of framing. The simple act of inserting a letter into an envelope
separates one piece of information from another; the envelope serves as the delimiter. In addition,
each envelope defines the sender and receiver addresses since the postal system is a many-to-many
carrier facility).
3-94
DATA COMMUNICATION
3.6.1.2 Character Oriented Framing
• Data to be carried are 8-bit characters from a coding system such as ASCII (Figure 11.1).
• The header and the trailer are also multiples of 8 bits.
1) Header carries the source and destination-addresses and other control information.
2) Trailer carries error-detection or error-correction redundant bits.
• To separate one frame from the next frame, an 8- bit (I-byte) flag is added at the beginning and the
end of a frame.
• The flag is composed of protocol-dependent special characters.
• The flag signals the start or end of a frame.
• Problem:
Character-oriented framing is suitable when only text is exchanged by the data-link-layers.
However, if we send other type of information (say audio/video), then any pattern used for
the flag can also be part of the information.
If the flag-pattern appears in the data-section, the receiver might think that it has reached
the end of the frame.
Solution: A byte-stuffing is used.
(Byte stuffing character stuffing)
• In byte stuffing, a special byte is added to the data-section of the frame when there is a character
with the same pattern as the flag.
• The data-section is stuffed with an extra byte. This byte is called the escape character (ESC), which
has a predefined bit pattern.
• When a receiver encounters the ESC character, the receiver
→ removes ESC character from the data-section and
→ treats the next character as data, not a delimiting flag.
• Problem:
What happens 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:
Escape characters part of the text must also be marked by another escape character (Fig 11.2).
• In short, byte stuffing is the process of adding one extra byte whenever there is a flag or escape
character in the text.
3-95
DATA COMMUNICATION
3.6.1.3 Bit Oriented Framing
• The data-section of a frame is a sequence of bits to be interpreted by the upper layer as text, audio,
video, and so on.
• However, in addition to headers and trailers, we need a delimiter to separate one frame from the
other.
• Most protocols use a special 8-bit pattern flag 01111110 as the delimiter to define the beginning and
the end of the frame (Figure 11.3).
• Problem:
If the flag-pattern appears in the data-section, the receiver might think that it has reached
the end of the frame.
Solution: A bit-stuffing is used.
• 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. (Figure 11.4).
• This guarantees that the flag field sequence does not inadvertently appear in the frame.
• In short, bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0 in
the data, so that the receiver does not mistake the pattern 0111110 for a flag.
3-96
DATA COMMUNICATION
3.6.2 Flow Control and Error Control
• One of the responsibilities of the DLC sublayer is flow and error control at the data-link layer.
3.6.2.1 Flow Control
• Whenever an entity produces items and another entity consumes them, there should be a balance
between production and consumption rates.
• If the items are produced faster than they can be consumed, the consumer can be overwhelmed and
may need to discard some items.
• We need to prevent losing the data items at the consumer site.
• At the sending node, the data-link layer tries to push frames toward the data-link layer at the
receiving node (Figure 11.5).
• If the receiving node cannot process and deliver the packet to its network at the same rate that the
frames arrive, it becomes overwhelmed with frames.
• Here, flow control can be feedback from the receiving node to the sending node to stop or slow down
pushing frames.
3.6.2.1.1 Buffers
• Flow control can be implemented by using buffer.
• A buffer is a set of memory locations that can hold packets at the sender and receiver.
• Normally, two buffers can be used.
1) First buffer at the sender.
2) Second buffer at the receiver.
• The flow control communication can occur by sending signals from the consumer to the producer.
• When the buffer of the receiver is full, it informs the sender to stop pushing frames.
3-97
DATA COMMUNICATION
3.6.3 Connectionless and Connection-Oriented
• A DLC protocol can be either connectionless or connection-oriented.
1) Connectionless Protocol
Frames are sent from one node to the next without any relationship between the frames;
each frame is independent.
The term connectionless does not mean that there is no physical connection (transmission
medium) between the nodes; it means that there is no connection between frames.
The frames are not numbered and there is no sense of ordering.
Most of the data-link protocols for LANs are connectionless protocols.
2) Connection Oriented Protocol
A logical connection should first be established between the two nodes (setup phase).
After all frames that are somehow related to each other are transmitted (transfer phase), the
logical connection is terminated (teardown phase).
The frames are numbered and sent in order.
If the frames are not received in order, the receiver needs to wait until all frames belonging
to the same set are received and then deliver them in order to the network layer.
Connection oriented protocols are rare in wired LANs, but we can see them in some point-to-
point protocols, some wireless LANs, and some WANs.
3-98
DATA COMMUNICATION
3.7 DATA LINK LAYER PROTOCOLS
• Traditionally 2 protocols have been defined for the data-link layer to deal with flow and error control:
1) Simple Protocol and 2) Stop-and-Wait Protocol.
• The behavior of a data-link-layer protocol can be better shown as a finite state machine (FSM).
• An FSM is a machine with a finite number of states (Figure 11.6).
• The machine is always in one of the states until an event occurs.
• Each event is associated with 2 reactions:
1) Defining the list (possibly empty) of actions to be performed.
2) Determining the next state (which can be the same as the current state).
• One of the states must be defined as the initial state, the state in which the machine starts when it
turns on.
3.7.1.1 Design
• Here is how it works (Figure 11.7):
1) At Sender
¤ The data-link-layer
→ gets data from its network-layer
→ makes a frame out of the data and
→ sends the frame.
2) At Receiver
¤ The data-link-layer
→ receives a frame from its physical layer
→ extracts data from the frame and
→ delivers the data to its network-layer.
Data-link-layers of sender & receiver provide transmission services for their network-layers.
Data-link-layers use the services provided by their physical layers for the physical
transmission of bits.
3-99
DATA COMMUNICATION
3.7.1.2 FSMs
• Two main requirements:
1) The sender-site cannot send a frame until its network-layer has a data packet to send.
2) The receiver-site cannot deliver a data packet to its network-layer until a frame arrives.
• These 2 requirements are shown using two FSMs.
• Each FSM has only one state, the ready state.
Example 3.6
3-
100
DATA COMMUNICATION
3.7.2 Stop & Wait Protocol
• This uses both flow and error control.
• Normally, the receiver has limited storage-space.
• If the receiver is receiving data from many sources, the receiver may
→ be overloaded with frames &
→ discard the frames.
• To prevent the receiver from being overloaded with frames, we need to tell the sender to slow down.
3.7.2.1 Design
1) At Sender
The sender
→ sends one frame & starts a timer
→ keeps a copy of the sent-frame and
→ waits for ACK-frame from the receiver (okay to go ahead).
Then,
1) If an ACK-frame arrives before the timer expires, the timer is stopped and the sender
sends the next frame.
Also, the sender discards the copy of the previous frame.
2) If the timer expires before ACK-frame arrives, the sender resends the previous frame
and restarts the timer
2) At Receiver
To detect corrupted frames, a CRC is added to each data frame.
When a frame arrives at the receiver-site, the frame is checked.
If frame’s CRC is incorrect, the frame is corrupted and discarded.
The silence of the receiver is a signal for the sender that a frame was either corrupted or lost.
3.7.2.2 FSMs
3-
101
DATA COMMUNICATION
ii) Blocking State: When the sender is in this state, three events can occur:
a) If a time-out occurs, the sender resends the saved copy of the frame and
restarts the timer.
b) If a corrupted ACK arrives, it is discarded.
c) If an error-free ACK arrives, the sender stops the timer and discards the saved
copy of the frame. It then moves to the ready state.
2) Receiver
• The receiver is always in the ready state. Two events may occur:
a) If an error-free frame arrives, the message in the frame is delivered to the network
layer and an ACK is sent.
b) If a corrupted frame arrives, the frame is discarded.
Example 3.7
3-
102
DATA COMMUNICATION
3.7.2.3 Sequence and Acknowledgment Numbers
• Q: How to deal with corrupted-frame?
Ans: If the corrupted-frame arrives at the receiver-site, then the frame is simply discarded.
• Q: How to deal with lost-frames?
Ans: If the receiver receives out-of-order data-frame, then it means that frames were lost. .’.
The lost-frames need to be resent.
• Problem in Stop and Wait protocols:
1) There is no way to identify a frame.
2) The received-frame could be the correct one, or a duplicate, or a frame out of order.
Solution: 1) Use sequence-number for each data frame.
2) Use Acknowledgment-number for each ACK frame.
Sequence Numbers
Frames need to be numbered. This is done by using sequence-numbers.
A sequence-number field is added to the data-frame.
Acknowledgment Numbers
An acknowledgment-number field is added to the ACK-frame.
Sequence numbers are 0, 1, 0, 1, 0, 1, . . .
The acknowledgment numbers can also be 1, 0, 1, 0, 1, 0, …
The acknowledgment-numbers always announce the sequence-number of the next frame
expected by the receiver.
For example,
If frame-0 has arrived safely, the receiver sends an ACK-frame with acknowledgment-1
(meaning frame-1 is expected next).
Example 3.8
3.7.3 Piggybacking
• A technique called piggybacking is used to improve the efficiency of the bidirectional protocols.
• The data in one direction is piggybacked with the acknowledgment in the other direction.
• In other words, when node A is sending data to node B, Node A also acknowledges the data received
from node B.
3-
103
DATA COMMUNICATION
3.8 High-Level Data Link Control (HDLC)
• HDLC is a bit-oriented protocol for communication over point-to-point and multipoint links.
• HDLC implements the ARQ mechanisms.
3.8.1 Configurations and Transfer Modes
• HDLC provides 2 common transfer modes that can be used in different configurations:
1) Normal response mode (NRM)
2) Asynchronous balanced mode (ABM).
NRM
• The station configuration is unbalanced (Figure 11.14).
• We have one primary station and multiple secondary stations.
• A primary station can send commands, a secondary station can only respond.
• The NRM is used for both point-to-point and multiple-point links.
ABM
• The configuration is balanced (Figure 11.15).
• Link is point-to-point, and each station can function as a primary and a secondary (acting as peers).
• This is the common mode today.
3-
104
DATA COMMUNICATION
3.8.2 Framing
• To provide the flexibility necessary to support all the options possible in the modes and
configurations, HDLC defines three types of frames:
1) Information frames (I-frames): are used to transport user data and control information
relating to user data (piggybacking).
2) Supervisory frames (S-frames): are used only to transport control information.
3) Unnumbered frames (U-frames): are reserved for system management.
Information carried by U-frames is intended for managing the link itself.
• Each type of frame serves as an envelope for the transmission of a different type of message.
3-
105
DATA COMMUNICATION
3.8.2.1.1 Control Fields of HDLC Frames
• The control field determines the type of frame and defines its functionality (Figure 11.17).
3-
106
DATA COMMUNICATION
3) Control Field for U-Frames
• Unnumbered frames are used to exchange session management and control information between
connected devices.
• U-frames contain an information field used for system management information, but not user data.
• Much of the information carried by U-frames is contained in codes included in the control field.
• U-frame codes are divided into 2 sections:
i) A 2-bit prefix before the P/F bit
ii) A 3-bit suffix after the P/F bit.
• Together, these two segments (5 bits) can be used to create up to 32 different types of U-frames.
Example 3.9
3-
107
DATA COMMUNICATION
3.9 POINT-TO-POINT PROTOCOL (PPP)
• PPP is one of the most common protocols for point-to-point access.
• Today, millions of Internet users who connect their home computers to the server of an ISP use PPP.
3.9.1 Framing
• PPP uses a character-oriented (or byte-oriented) frame (Figure 11.20).
3-
108
DATA COMMUNICATION
3.9.2 Transition Phases
• The transition diagram starts with the dead state (Figure 11.21).
1) Dead State
In dead state, there is no active carrier and the line is quiet.
2) Establish State
When 1 of the 2 nodes starts communication, the connection goes into the establish state.
In establish state, options are negotiated between the two parties.
3) Authenticate State
If the 2 parties agree that they need authentication,
Then the system needs to do authentication;
Otherwise, the parties can simply start communication.
4) Open State
Data transfer takes place in the open state.
5) Terminate State
When 1 of the endpoints wants to terminate connection, the system goes to terminate state.
3-
109
DATA COMMUNICATION
4.1 Introduction
• When nodes use shared-medium, we need multiple-access protocol to coordinate access to medium.
• Analogy:
This problem is similar to the rules of speaking in an assembly.
We need to ensure
→ Each people has right to speak.
→ Two people do not speak at the same time
→ Two people do not interrupt each other (i.e. Collision Avoidance)
• Many protocols have been designed to handle access to a shared-link (Figure 12.1).
• These protocols belong to a sublayer in the data-link layer called Media Access Control (MAC).
1) Four random-access protocols (or Contention Methods):
i) ALOHA ii) CSMA iii) CSMA/CD iv) CSMA/CA
These protocols are mostly used in LANs and WANs.
2) Three controlled-access protocols:
i) Reservation ii) Polling iii) Token-passing
Some of these protocols are used in LANs.
3) Three channelization protocols:
i) FDMA ii) TDMA iii) CDMA
These protocols are used in cellular telephony.
4-
110
DATA COMMUNICATION
1) ALOHA
2) CSMA (Carrier Sense Multiple Access)
3) CSMA/CD (Carrier Sense Multiple Access with Collision-detection)
4) CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)
4-
111
DATA COMMUNICATION
4.2.1 ALOHA
• ALOHA was designed for a wireless LAN, but it can be used on any shared medium.
• Since the medium is shared between the stations, there is possibility of collisions.
• When 2 or more stations send the data simultaneously, there is possibility of collision & data loss.
4-
112
DATA COMMUNICATION
4.2.1.1.1 Vulnerable Time
• The vulnerable-time is defined as a time during which there is a possibility of collision.
• In Figure 12.4,
If station B sends a frame between t-Tfr and t, this leads to a collision between the frames
from station A and station B.
If station C sends a frame between t and t+Tfr, this leads to a collision between the frames
from station A and station C.
Example 4.1
4.2.1.1.2 Throughput
• The average number of successful transmissions is given by
Example 4.2
4-
113
DATA COMMUNICATION
4.2.1.2 Slotted ALOHA
• Slotted ALOHA was invented to improve the efficiency of pure ALOHA.
• The time is divided into time-slots of Tfr seconds (Figure 12.5).
• The stations are allowed to send only at the beginning of the time-slot.
• If a station misses the time-slot, the station must wait until the beginning of the next time-slot.
• If 2 stations try to resend at beginning of the same time-slot, the frames will collide again (Fig 12.6).
4.2.1.2.1 Throughput
• The average number of successful transmissions is given by
Example 4.3
4-
114
DATA COMMUNICATION
4.2.2 CSMA
• CSMA was developed to minimize the chance of collision and, therefore, increase the performance.
• CSMA is based on the principle “sense before transmit” or “listen before talk.”
• Here is how it works:
1) Each station checks the state of the medium: idle or busy.
2) i) If the medium is idle, the station sends the data.
i) If the medium is busy, the station defers sending.
• CSMA can reduce the possibility of collision, but it cannot eliminate it.
4-
115
DATA COMMUNICATION
4.2.2.2 Persistence Methods
• Q: What should a station do if the channel is busy or idle?
Three methods can be used to answer this question:
1) 1-persistent method 2) Non-persistent method and 3) p-persistent method
1) 1-Persistent
• Before sending a frame, a station senses the line (Figure 12.10a).
i) If the line is idle, the station sends immediately (with probability = 1).
ii) If the line is busy, the station continues sensing the line.
• This method has the highest chance of collision because 2 or more stations:
→ may find the line idle and
→ send the frames immediately.
2) Non-Persistent
• Before sending a frame, a station senses the line (Figure 12.10b).
i) If the line is idle, the station sends immediately.
ii) If the line is busy, the station waits a random amount of time and then senses the line again.
• This method reduces the chance of collision because 2 or more stations:
→ will not wait for the same amount of time and
→ will not retry to send simultaneously.
3) P-Persistent
• This method is used if the channel has time-slots with a slot-duration equal to or greater than the
maximum propagation time (Figure 12.10c).
• Advantages:
i) It combines the advantages of the other 2 methods.
ii) It reduces the chance of collision and improves efficiency.
• After the station finds the line idle, it follows these steps:
1) With probability p, the station sends the frame.
2) With probability q=1-p, the station waits for the beginning of the next time-slot and checks
the line again.
i) If line is idle, it goes to step 1.
ii) If line is busy, it assumes that collision has occurred and uses the back off procedure.
4-
116
DATA COMMUNICATION
4.2.3 CSMA/CD
• Disadvantage of CSMA: CSMA does not specify the procedure after a collision has occurred.
Solution: CSMA/CD enhances the CSMA to handle the collision.
• Here is how it works (Figure 12.12):
1) A station
→ sends the frame &
→ then monitors the medium to see if the transmission was successful or not.
2) If the transmission was unsuccessful (i.e. there is a collision), the frame is sent again.
Example 4.4
4-
117
DATA COMMUNICATION
4.2.3.2 Procedure
• CSMA/CD is similar to ALOHA with 2 differences (Figure 12.13):
1) Addition of the persistence process.
¤ We need to sense the channel before sending the frame by using non-persistent, 1-
persistent or p-persistent.
2) Frame transmission.
i) In ALOHA, first the entire frame is transmitted and then acknowledgment is waited for.
ii) In CSMA/CD, transmission and collision-detection is a continuous process.
4.2.3.4 Throughput
• The throughput of CSMA/CD is greater than pure or slotted ALOHA.
• The maximum throughput is based on
→ different value of G
→ persistence method used (non-persistent, 1-persistent, or p-persistent) and
→ ‘p‟ value in the p-persistent method.
• For 1-persistent method, the maximum throughput is 50% when G =1.
• For non-persistent method, the maximum throughput is 90% when G is between 3 and 8.
4-
118
DATA COMMUNICATION
4.2.4 CSMA/CA
• Here is how it works (Figure 12.15):
1) A station needs to be able to receive while transmitting to detect a collision.
i) When there is no collision, the station receives one signal: its own signal.
ii) When there is a collision, the station receives 2 signals:
a) Its own signal and
b) Signal transmitted by a second station.
2) To distinguish b/w these 2 cases, the received signals in these 2 cases must be different.
4-
119
DATA COMMUNICATION
2) Contention Window
• The contention-window is an amount of time divided into time-slots.
• A ready-station chooses a random-number of slots as its wait time.
• In the window, the number of slots changes according to the binary exponential back-off strategy.
• For example:
At first time, number of slots is set to one slot and
Then, number of slots is doubled each time if the station cannot detect an idle channel.
3) Acknowledgment
• There may be a collision resulting in destroyed-data.
• In addition, the data may be corrupted during the transmission.
• To help guarantee that the receiver has received the frame, we can use
i) Positive acknowledgment and
ii) Time-out timer
4-
120
DATA COMMUNICATION
4.2.4.2 Network Allocation Vector
• When a source-station sends an RTS, it includes the duration of time that it needs to occupy the
channel.
• The remaining stations create a timer called a network allocation vector (NAV).
• NAV indicates waiting time to check the channel for idleness.
• Each time a station accesses the system and sends an RTS frame, other stations start their NAV.
4-
121
DATA COMMUNICATION
4.3 CONTROLLED ACCESS PROTOCOLS
• Here, the stations consult one another to find which station has the right to send.
• A station cannot send unless it has been authorized by other stations.
• Three popular controlled-access methods are: 1) Reservation 2) Polling 3) Token Passing
4.3.1 Reservation
• Before sending data, each station needs to make a reservation of the medium.
• Time is divided into intervals.
• In each interval, a reservation-frame precedes the data-frames.
• If no. of stations = N, then there are N reservation mini-slots in the reservation-frame.
• Each mini-slot belongs to a station.
• When a station wants to send a data-frame, it makes a reservation in its own minislot.
• The stations that have made reservations can send their data-frames.
4-
122
DATA COMMUNICATION
4.3.2 Polling
• In a network,
One device is designated as a primary station and
Other devices are designated as secondary stations.
• Functions of primary-device:
1) The primary-device controls the link.
2) The primary-device is always the initiator of a session.
3) The primary-device is determines which device is allowed to use the channel at a given time.
4) All data exchanges must be made through the primary-device.
• The secondary devices follow instructions of primary-device.
• Disadvantage: If the primary station fails, the system goes down.
• Poll and select functions are used to prevent collisions (Figure 12.19).
1) Select
If the primary wants to send data, it tells the secondary to get ready to receive; this is called
select function.
The primary
→ alerts the secondary about upcoming transmission by sending select frame (SEL)
→ then waits for an acknowledgment (ACK) from secondary
→ then sends the data frame and
→ finally waits for an acknowledgment (ACK) from the secondary.
2) Poll
If the primary wants to receive data, it asks the secondaries if they have anything to send;
this is called poll function.
When the first secondary is approached, it responds either
→ with a NAK frame if it has no data to send or
→ with data-frame if it has data to send.
i) If the response is negative (NAK frame), then the primary polls the next secondary in
the same manner.
ii) When the response is positive (a data-frame), the primary
→ reads the frame and
→ returns an acknowledgment (ACK frame).
4-
123
DATA COMMUNICATION
4.3.3 Token Passing
• In a network, the stations are organized in a ring fashion i.e. for each station; there is a predecessor
and a successor.
1) The predecessor is the station which is logically before the station in the ring.
2) The successor is the station which is after the station in the ring.
• The current station is the one that is accessing the channel now.
• A token is a special packet that circulates through the ring.
• Here is how it works:
A station can send the data only if it has the token.
When a station wants to send the data, it waits until it receives the token from its
predecessor.
Then, the station holds the token and sends its data.
When the station finishes sending the data, the station
→ releases the token
→ passes the token to the successor.
• Main functions of token management:
1) Stations must be limited in the time they can hold the token.
2) The token must be monitored to ensure it has not been lost or destroyed.
For ex: if a station that is holding the token fails, the token will disappear from the network
3) Assign priorities
→ to the stations and
→ to the types of data being transmitted.
4) Make low-priority stations release the token to high priority stations.
4-
124
DATA COMMUNICATION
2) Dual Ring Topology
• A second (auxiliary) ring
→ is used along with the main ring (Figure 12.20b).
→ operates in the reverse direction compared with the main ring.
→ is used for emergencies only (such as a spare tire for a car).
• If the main ring fails, the system automatically combines the 2 rings to form a temporary ring.
• After the failed link is restored, the second ring becomes idle again.
• Each station needs to have 2 transmitter-ports and 2 receiver-ports.
• This topology is used in
i) FDDI (Fiber Distributed Data Interface) and
ii) CDDI (Copper Distributed Data Interface).
4-
125
DATA COMMUNICATION
4.4 CHANNELIZATION PROTOCOLS
• Channelization is a multiple-access method.
• The available bandwidth of a link is shared b/w different stations in time, frequency, or through code.
• Three channelization protocols:
1) FDMA (Frequency Division Multiple Access)
2) TDMA (Time Division Multiple Access) and
3) CDMA (Code Division Multiple Access)
4.4.1 FDMA
• The available bandwidth is divided into frequency-bands (Figure 12.21).
• Each band is reserved for a specific station.
• Each station can send the data in the allocated band.
• Each station also uses a bandpass filter to confine the transmitter frequencies.
• To prevent interferences, small guard bands are used to separate the allocated bands from one
another.
4-
126
DATA COMMUNICATION
4.4.2 TDMA
• The stations share the bandwidth of the channel in time (Figure 12.22).
• Each time-slot is reserved for a specific station.
• Each station can send the data in the allocated time-slot.
4-
127
DATA COMMUNICATION
4.4.3 CDMA
• CDMA simply means communication with different codes.
• CDMA differs from FDMA because
→ only one channel occupies the entire bandwidth of the link.
• CDMA differs from TDMA because
→ all stations can send data simultaneously; there is no timesharing.
4.4.3.1 Implementation
• Let us assume we have four stations 1, 2, 3, and 4 connected to the same channel.
• The data from station-1 are d1, from station-2 are d2, and so on.
• The code assigned to the first station is c1, to the second is c2, and so on.
• We assume that the assigned codes have 2 properties.
1) If we multiply each code by another, we get 0.
2) If we multiply each code by itself, we get 4 (the number of stations).
The receiver multiplies the data on the channel by the code of the sender.
For example, suppose stations 1 and 2 are talking to each other.
Station-2 wants to hear what station-1 is saying.
Station-2 multiplies the data on the channel by c1 the code of station-1.
(c1.c1)=4, (c2.c1)=0, (c3.c1)=0, and (c4.c1)=0,
Therefore, station-2 divides the result by 4 to get the data from station-1.
4-
128
DATA COMMUNICATION
4.4.3.2 Chips
• CDMA is based on coding theory.
• Each station is assigned a code, which is a sequence of numbers called chips (Figure 12.24).
• These sequences were carefully selected & are called orthogonal sequences
• These sequences have the following properties:
1) Each sequence is made of N elements, where N is the number of stations.
2) Multiplication of a sequence by a scalar:
If we multiply a sequence by a number i.e. every element in the sequence is multiplied
by that element.
For example,
5) Adding 2 sequences means adding the corresponding elements. The result is another
sequence.
For example,
4-
129
DATA COMMUNICATION
4.4.3.4 Encoding and Decoding
• We assume that
Stations 1 and 2 are sending a 0 bit.
Station-4 is sending a 1 bit.
Station-3 is silent.
• Here is how it works (Figure 12.26):
At the sender-site, the data are translated to -1, -1, 0, and +1.
Each station multiplies the corresponding number by its chip (its orthogonal sequence).
The result is a new sequence which is sent to the channel.
The sequence on the channel is the sum of all 4 sequences.
Now imagine station-3, which is silent, is listening to station-2.
Station-3 multiplies the total data on the channel by the code for station-2, which is [+1 -1
+1-1], to get
4-
130
DATA COMMUNICATION
4.4.3.5 Sequence Generation
• To generate chip sequences, we use a Walsh table (Figure 12.29).
• Walsh table is a 2-dimensional table with an equal number of rows and columns.
Example 4.5
Example 4.6
Example 4.7
4-
131
DATA COMMUNICATION
5-
132
DATA COMMUNICATION
5.4 INTERNET PROTOCOL (IP)
5.5.1 Internet Protocol (IP)
• IP is main protocol responsible for packetizing, forwarding & delivery of a packet at network layer.
• IP is an unreliable datagram protocol.
• IP provides a best-effort delivery service.
• The term best-effort means that the packets can
→ be corrupted
→ be lost or
→ arrive out-of-order.
• If reliability is important, IP must be paired with a TCP which is reliable transport-layer protocol.
• IP is a connectionless protocol.
• IP uses the datagram approach.
1) Each datagram is handled independently.
2) Each datagram can follow a different route to the destination.
3) Datagrams may arrive out-of-order at the destination.
5-
133
DATA COMMUNICATION
5.5.2 Datagram Format
• IP uses the packets called datagrams.
• A datagram consist of 2 parts (Figure 19.2): 1) Payload 2) Header.
1) Payload
• Payload (or Data) is the main reason for creating a datagram.
• Payload is the packet coming from other protocols that use the service of IP.
2) Header
• Header contains information essential to routing and delivery.
• IP header contains following fields:
1) Version Number (VER)
This field indicates version number used by the packet. Current version=4
2) Header Length (HLEN)
This field specifies length of header.
When a device receives a datagram, the device needs to know
→ when the header stops and
→ when the data starts.
3) Service Type
This field specifies priority of packet based on delay, throughput, reliability & cost
requirements.
4) Total Length
This field specifies the total length of the datagram (header plus data).
Maximum length=65535 bytes.
5) Identification, Flags, and Fragmentation Offset
These 3 fields are used for fragmentation and reassembly of the datagram.
Fragmentation occurs when the size of the datagram is larger than the MTU of the network.
6) Time-to-Live (TTL)
This field is indicates amount of time, the packet is allowed to remain in the network.
If TTL becomes 0 before packet reaches destination, the router
→ discards packet and
→ sends an error-message back to the source.
7) Protocol
This field specifies upper-layer protocol that is to receive the packet at the destination-host.
For example (Figure 19.3):
For TCP, protocol = 6 For UDP, protocol = 17
8) Header Checksum
This field is used to verify integrity of header only.
If the verification process fails, packet is discarded.
9) Source and Destination Addresses
These 2 fields contain the IP addresses of source and destination hosts.
10) Options
This field allows the packet to request special features such as
→ security level
→ route to be taken by packet and
→ timestamp at each router.
This field can also be used for network testing and debugging.
11) Padding
This field is used to make the header a multiple of 32-bit words.
5-
134
DATA COMMUNICATION
Example 5.3
Example 5.4
Example 5.5
5-
135
DATA COMMUNICATION
5.5.3 Fragmentation
5.5.3.1 Maximum Transfer Unit (MTU)
• Each network imposes a restriction on maximum size of packet that can be carried. This is called the
MTU (maximum transmission unit).
• For example:
For Ethernet, MTU = 1500 bytes
For FDDI, MTU = 4464 bytes
• When IP wants send a packet that is larger than MTU of physical-network, IP breaks packet into
smaller fragments. This is called fragmentation (Figure 19.5).
• Designers have decided to make the maximum length of IP datagram = 65,535 bytes. This ensures
that the IP protocol is independent of the physical network,
• When a datagram is fragmented, each fragment has its own header.
• A fragmented-datagram may itself be fragmented if it encounters a network with an even smaller
MTU.
• Source host or router is responsible for fragmentation of original datagram into the fragments.
Destination host is responsible for reassembling the fragments into the original datagram.
5-
136
DATA COMMUNICATION
Example 5.6
Example 5.7
Example 5.8
Example 5.9
Example 5.10
5-
137
DATA COMMUNICATION
5.5.4 Options
• This field allows the packet to request special features such as
→ security level
→ route to be taken by packet and
→ timestamp at each router.
• This field can also be used for network testing and debugging.
• As the name implies, options are not required for a datagram.
• The header is made of two parts: 1) Fixed part and 2) Variable part.
1) Maximum size of Fixed part = 20 bytes.
2) Maximum size of Variable part = 40 bytes
• Options are divided into two broad categories: 1) Single-byte options and 2) Multiple-byte options.
1) Single Byte Options
i) No Operation
This option is used as filler between options.
ii) End of Option
This option is used for padding at the end of the option field.
2) Multiple Byte Options
i) Record Route
This option is used to record the routers that handle the datagram.
This option can list up to 9 router-addresses.
ii) Strict Source Route
This option is used by the source to pre-determine a route for the datagram.
Useful purposes: The sender can choose a route with a specific type of service, such as
→ minimum delay
→ maximum throughput or
→ more secure/reliable.
All the defined-routers must be visited by the datagram.
If the datagram visits a router that is not on the list, the datagram is discarded.
iii) Loose Source Route
This option is similar to the strict source route, but it is less rigid.
Each router in the list must be visited, but the datagram can visit other routers as well.
iv) Timestamp
This option is used to record the time of datagram processing by a router.
The time is expressed in milliseconds from midnight GMT (Greenwich Mean Time).
The recorded-time can help the managers to track the behavior of the routers in the Internet.
5-
138
DATA COMMUNICATION
5.5.5 Security of IPv4 Datagrams
• Nowadays, the Internet is not secure anymore.
• Three security issues applicable to the IP protocol:
1) Packet sniffing
2) Packet modification and
3) IP spoofing.
1) Packet Sniffing
• Attackers may
→ capture certain packets
→ intercept the packets and
→ make a copy of the packets.
• Packet sniffing is a passive attack.
• Passive attack means the attacker does not modify the contents of the packet.
• The attack is difficult to detect „.‟ sender & receiver may never know that the packet has been copied.
• Solution:
Although the attack cannot be stopped, encryption of packet may make the attacker‟s job difficult.
The attacker may still sniff the packet, but the content is not detectable (or understandable).
2) Packet Modification
• Attackers may succeed in accessing the content of a packet.
• Then, the attacker can
→ change the address of the packet or
→ change the data of the packet
• Solution:
The attack can be prevented by data integrity mechanism.
Data integrity guarantees that the packet is not modified during the transmission.
3) IP Spoofing
• The attacker pretends as a trusted entity and obtains all the secret information.
• For example:
An attacker sends an IP packet to a bank pretending as legitimate customers.
• Solution:
The attack can be prevented using an origin-authentication mechanism.
5-
139
DATA COMMUNICATION
5.5 ICMP
• ICMP is a network-layer protocol.
• This is used to handle error and other control messages.
5.6.1 MESSAGES
• ICMP messages are divided into 2 broad categories:
1) Error Reporting Messages
These messages report problems that a router or a host may encounter during the processing
of datagram.
2) Query Messages
These messages help a host or a network manager get specific information from a router or
another host.
For example:
Nodes can discover their neighbors.
Hosts can discover and learn about routers on their network.
Routers can help a node redirect the messages.
• Fields of ICMP messages (Figure 19.8):
1) Type: This field identifies the type of message.
2) Code: This field specifies the reason for the particular message type.
For example,
Type 03 = problem reaching the destinations
Type 11 = problem related to time exceeded.
3) Checksum: This field is used to detect errors in the ICMP message.
4) Data Section: This field can be used for diagnostic purposes by matching the information in
the ICMP message with the original data in the IP packet.
5-
140
DATA COMMUNICATION
5.6.1.1 Error Reporting Messages
• Main responsibility of ICMP: To report some errors that may occur during the processing of the
datagram (Figure 19.9).
• These messages report problems that a router or a host may encounter during the processing of
datagram.
• ICMP does not correct errors; ICMP simply reports the errors to the source.
• Error correction is left to the higher-level protocols (such as TCP or UDP)
5-
141
DATA COMMUNICATION
5.6.1.2 Query Messages
• These messages help a network manager to get specific information from a router or host.
• Two types of query messages: request (type 8) and reply (type 0).
1) Echo Request & Echo Reply
These messages are used to determine whether a remote-host is alive.
A source-host sends an echo request message to destination-host;
If the destination-host is alive, it responds with an echo reply message.
Type=8 is used for echo request
Type=0 is used for echo reply.
These messages can be used in two debugging tools: ping and traceroute.
2) Timestamp Request & Timestamp Reply
These messages are used to
→ find the round-trip time between two devices or
→ check whether the clocks in two devices are synchronized.
The timestamp request sends a number, which defines the time the message is sent.
The timestamp reply resends another number, which defines the time the message is sent.
The timestamp reply also includes 2 new numbers representing
i) the time the request was received and
ii) the time the response was sent.
Type=13 is used for timestamp request
Type=14 is used for timestamp reply.
5-
142
DATA COMMUNICATION
5.6.2 Debugging Tools
• There are several tools that can be used in the Internet for debugging.
• We can determine the viability of a host or router.
• We can trace the route of a packet.
• Two tools used for debugging: 1) Ping and 2) Traceroute.
5.6.2.1 Ping
• The ping program can be used to find if a host is alive and responding
• Here, ping is used to see how it uses ICMP packets
• The source host sends ICMP echo-request messages;
The destination, if alive, responds with ICMP echo-reply messages.
• The ping program
→ sets the identifier field in the echo-request and echo-reply message and
→ starts the sequence number from 0; this number is incremented by 1 each time a new
message is sent.
• Ping can calculate the round-trip time.
It inserts the sending time in the data section of the message.
When the packet arrives, it subtracts the arrival time from the departure time to get the
round-trip time (RTT).
5.6.2.2 Traceroute
• The traceroute program can be used to trace the path of a packet from a source to the destination.
• It can find the IP addresses of all the routers that are visited along the path.
• The program is usually set to check for the maximum of 30 hops (routers) to be visited.
Traceroute
The traceroute program is different from the ping program.
The ping program gets help from 2 query messages;
The traceroute program gets help from two error-reporting messages: time-exceeded
and destination-unreachable.
The traceroute is an application layer program, but only the client program is needed.
In other words, there is no traceroute server program.
The traceroute application program is encapsulated in a UDP user datagram, but traceroute
intentionally uses a port number that is not available at the destination.
5-
143
DATA COMMUNICATION
5.6 MOBILE IP
• Mobile IP is the extension of IP protocol.
• Mobile IP allows mobile computers to be connected to the Internet.
5.7.1 Addressing
• In Mobile IP, the main problem that must be solved is addressing.
5.7.1.1 Stationary Hosts
• The original IP addressing assumed that a host is stationary.
• A router uses an IP address to route an IP datagram.
• An IP address has two parts: a prefix and a suffix.
• The prefix associates a host with a network.
For example, the IP address 10.3.4.24/8 defines a host attached to the network 10.0.0.0/8.
• The address is valid only when the host is attached to the network.
• If the network changes, the address is no longer valid.
5.7.1.2 Mobile Hosts
• When a host moves from one network to another, the IP addressing structure needs to be modified.
• The host has two addresses (Figure 19.12):
1) Home address &
2) Care-of address
1) Home Address
Original address of host called the home address.
The home address is permanent.
The home address associates the host with its home network.
Home network is a network that is the permanent home of the host.
2) Care-of-Address
The care-of address is temporary.
The care-of address changes as the mobile-host moves from one network to another.
Care-of address is associated with the foreign network.
Foreign network is a network to which the host moves.
When a mobile-host visits a foreign network, it receives its care-of address during the agent
discovery and registration phase.
5-
144
DATA COMMUNICATION
5.7.2 Agents
• Two agents are required to make change of address transparent to rest of the Internet (Fig 19.13):
1) Home-agent and
2) Foreign-agent.
1) Home Agent
• The home-agent is a router attached to the home network.
• The home-agent acts on behalf of mobile-host when a remote-host sends a packet to mobile-host.
• The home-agent receives and delivers packets sent by the remote-host to the foreign-agent.
2) Foreign Agent
• The foreign-agent is a router attached to the foreign network.
• The foreign-agent receives and delivers packets sent by the home-agent to the mobile-host.
• The mobile-host can also act as a foreign-agent i.e. mobile-host and foreign-agent can be the same.
• However, to do this, a mobile-host must be able to receive a care-of address by itself.
• In addition, the mobile-host needs the necessary software to allow it to communicate with the home-
agent and to have two addresses: i) its home address and ii) its care-of address.
• This dual addressing must be transparent to the application programs.
Collocated Care-of-Address
When the mobile-host and the foreign-agent are the same, the care-of-address is called a
collocated care-of-address.
Advantage:
1) mobile-host can move to any network w/o worrying about availability of a foreign-agent.
Disadvantage:
1) The mobile-host needs extra software to act as its own foreign-agent.
5-
145
DATA COMMUNICATION
5.7.3 Three Phases
• To communicate with a remote-host, a mobile-host goes through 3 phases (Figure 19.14):
1) Agent Discovery: involves the mobile-host, the foreign-agent, and the home-agent.
2) Registration: involves the mobile-host, the foreign-agent, and the home-agent.
3) Data Transfer: Here, the remote-host is also involved.
5-
146
DATA COMMUNICATION
5.7.3.1 Agent Discovery
• Agent discovery consists of two subphases:
1) A mobile-host must discover (learn the address of) a home-agent before it leaves its home
network.
2) A mobile-host must also discover a foreign-agent after it has moved to a foreign network.
• This discovery consists of learning the care-of address as well as the foreign-agent‟s address.
• Two types of messages are used: i) advertisement and ii) solicitation.
1) Agent Advertisement
• When a router advertises its presence on a network using an ICMP router advertisement, it can
append an agent advertisement to the packet if it acts as an agent.
6) Care-of Addresses
This field contains a list of addresses available for use as care-of addresses.
The mobile-host can choose one of these addresses.
The selection of this care-of address is announced in the registration request.
2) Agent Solicitation
• When a mobile-host has moved to a new network and has not received agent advertisements, it can
initiate an agent solicitation.
• It can use the ICMP solicitation message to inform an agent that it needs assistance
5-
147
DATA COMMUNICATION
5.7.3.2 Registration
• After a mobile-host has moved to a foreign network and discovered the foreign-agent, it must
register.
• Four aspects of registration:
1) The mobile-host must register itself with the foreign-agent.
2) The mobile-host must register itself with its home-agent. This is normally done by the
foreign-agent on behalf of the mobile-host.
3) The mobile-host must renew registration if it has expired.
4) The mobile-host must cancel its registration (deregistration) when it returns home.
3) Lifetime
This field defines the number of seconds the registration is valid.
i) If the field is a string of 0s, the request message is asking for deregistration.
ii) This field If the field is a string of 1s, the lifetime is infinite.
4) Home Address
This field contains the permanent (first) address of the mobile-host.
5) Home Agent Address
This field contains the address of the home-agent.
5-
148
DATA COMMUNICATION
6) Care-of-Address
This field is the temporary (second) address of the mobile-host.
7) Identification
This field contains a 64-bit number that is inserted into the request by the mobile-host.
This field matches a request with a reply.
8) Extensions
This field is used for authentication.
This field allows a home-agent to authenticate the mobile agent.
2) Registration Reply
• A registration reply is sent from home-agent to foreign-agent and then relayed to the mobile-host.
• The reply confirms or denies the registration request. (Figure 19.17)
• The fields are similar to registration request with the 3 exceptions:
1) The value of the type field is 3.
2) The code field replaces the flag field and shows the result of the registration request
(acceptance or denial).
3) The care-of address field is not needed.
5-
149
DATA COMMUNICATION
5.7.3.3 Data Transfer
• After agent discovery & registration, a mobile-host can communicate with a remote-host (Fig 19.17).
5-
150
DATA COMMUNICATION
5.7.4 Inefficiency in Mobile IP
• Communication involving mobile IP can be inefficient.
• The inefficiency can be severe or moderate.
1) The severe case is called double crossing or 2X.
2) The moderate case is called triangle routing or dog-leg routing.
5.7.4.1 Double Crossing
• Double crossing occurs when a remote-host communicates with a mobile-host that has moved to the
same network (or site) as the remote-host (Figure 19.19).
• When the mobile-host sends a packet to the remote-host, there is no inefficiency; the communication
is local.
• However, when remote-host sends a packet to mobile-host, the packet crosses the Internet twice.
• Since a computer usually communicates with other local computers (principle of locality), the
inefficiency from double crossing is significant.
5.7.4.2 Triangle Routing
• Triangle routing occurs when the remote-host communicates with a mobile-host that is not attached
to the same network (or site) as the mobile-host.
• When the mobile-host sends a packet to the remote-host, there is no inefficiency.
• However, when the remote-host sends a packet to the mobile-host, the packet goes from the
remote-host to the home-agent and then to the mobile-host.
• The packet travels the two sides of a triangle, instead of just one side (Figure 19.20).
Solution
• One solution to inefficiency is for the remote-host to bind the care-of address to the home address of
a mobile-host.
• For example, when a home-agent receives the first packet for a mobile-host, it forwards the packet
to the foreign-agent; it could also send an update binding packet to the remote-host so that future
packets to this host could be sent to the care-of address.
• The remote-host can keep this information in a cache.
• The problem with this strategy is that the cache entry becomes outdated once the mobile-host
moves.
• In this case, the home-agent needs to send a warning packet to the remote-host to inform it of the
change.
5-
151
DATA COMMUNICATION
5.8.1 Representation
• Two notations can be used to represent IPv6 addresses: 1) binary and 2) colon hexadecimal.
5-
152
DATA COMMUNICATION
5.8.3 Address Space Allocation
• The address-space is divided into several blocks of varying size.
• Each block is allocated for a special purpose.
• The global routing prefix is used to route the packet through the Internet to the organization site,
such as the ISP that owns the block.
• Since the first 3 bits in this part are fixed (001), the rest of the 45 bits can be defined for up to 245
sites (a private organization or an ISP).
1) The global routers in Internet route a packet to its destination site based on the value of n.
2) The next m bits define a subnet in an organization.
3) The last q bits define the interface identifier.
• Two link layer addressing schemes:
1) 64-bit extended unique identifier (EUI-64) defined by IEEE and
2) 48-bit link-layer address defined by Ethernet.
5-
153
DATA COMMUNICATION
1) Mapping EUI-64
• To map a 64-bit physical address, the global/local bit of this format needs to be changed from 0 to 1
(local to global) to define an interface address (Figure 22.2).
5-
154
DATA COMMUNICATION
5.8.3.3 Other Assigned Blocks
• IPv6 uses 2 large blocks for private addressing and one large block for multicasting (Figure 22.5).
1) Unique Local Unicast Block
• A subblock in a unique local unicast block can be privately created and used by a site.
• The packet carrying this type of address as the destination address is not expected to be routed.
• This type of address has the identifier 1111 110.
• The next bit can be 0 or 1 to define how the address is selected (locally or by an authority).
2) Link Local Block
• A subblock in link local block can be used as a private address in a network.
• This type of address has the block identifier 1111111010.
• The next 54 bits are set to zero.
• The last 64 bits can be changed to define the interface for each computer.
5.8.4 Autoconfiguration
• When a host in IPv6 joins a network, it can configure itself using the following process:
1) The host first creates a link local address for itself.
This is done by
→ taking the 10-bit link local prefix (1111 1110 10)
→ adding 54 zeros and
→ adding the 64-bit interface identifier.
The result is a 128-bit link local address.
2) The host then tests to see if this link local address is unique and not used by other hosts.
Since the 64-bit interface identifier is supposed to be unique, the link local address generated
is unique with a high probability.
To check uniqueness, the host
→ sends a neighbor solicitation message and
→ waits for a neighbor advertisement message.
If any host in the subnet is using this link local address, the process fails and the host cannot
auto-configure itself.
3) If the uniqueness of the link local address is passed, the host stores this address as its link local
address (for private communication), but it still needs a global unicast address.
The host then sends a router solicitation message to a local router.
If there is a router running on the network, the host receives a router advertisement message
that includes
→ global unicast prefix and
→ subnet prefix that the host needs to add to its interface identifier to generate its
global unicast address.
If the router cannot help the host with the configuration, it informs the host in the router
advertisement message (by setting a flag).
5-
155
DATA COMMUNICATION
5.8 THE IPv6 PROTOCOL
5.9.1 Changes from IPv4 to IPv6 (Advantages of IPv6)
1) Header Format
IPv6 uses a new header format.
Options are
→ separated from the base-header and
→ inserted between the base-header and the data.
This speeds up the routing process (because most of the options do not need to be checked
by routers).
2) New Options
IPv6 has new options to allow for additional functionalities.
3) Extension
IPv6 is designed to allow the extension of the protocol if required by new technologies or
applications.
4) Resource Allocation
In IPv6,
→ type-of-service (TOS) field has been removed
→ two new fields: 1) traffic class and 2) flow label, are added to enable the source to
request special handling of the packet.
This mechanism can be used to support real-time audio and video.
5) Security
The encryption option provides confidentiality of the packet.
The authentication option provides integrity of the packet.
5-
156
DATA COMMUNICATION
5.9.2 Packet Format
8) Payload
The payload contains zero or more extension headers (options) followed by the data from
other protocols (UDP, TCP, and so on).
The payload can have many extension headers as required by the situation.
Each extension header has 2 mandatory fields (Figure 22.7):
1) Next header and
2) Length
• Two mandatory fields are followed by information related to the particular option.
5-
157
DATA COMMUNICATION
5.9.2.1 Concept of Flow & Priority in IPv6
• To a router, a flow is a sequence of packets that share the same characteristics such as
→ traveling the same path
→ using the same resources or
→ having the same kind of security
• A router that supports the handling of flow labels has a flow label table.
• The table has an entry for each active flow label.
Each entry defines the services required by the corresponding flow label.
• When a router receives a packet, the router consults its flow label table.
• Then, the router provides the packet with the services mentioned in the entry.
• A flow label can be used to support the transmission of real-time audio/video.
• Real-time audio/video requires resources such as
→ high bandwidth
→ large buffers or
→ long processing time
• Resource reservation guarantees that real-time data will not be delayed due to a lack of resources.
5-
158
DATA COMMUNICATION
5.9.3 Extension Header
• An IP packet is made of
→ base-header &
→ some extension headers.
• Length of base header = 40 bytes.
• To support extra functionalities, extension headers can be placed b/w base header and payload.
• Extension headers act like options in IPv4.
• Six types of extension headers (Figure 22.8):
1) Hop-by-hop option 2) Source routing 3) Fragmentation
4) Authentication 5) Encrypted security payload 5) Destination option.
1) Hop-by-Hop Option
• This option is used when the source needs to pass information to all routers visited by the datagram.
• Three options are defined: i) Pad1, ii) PadN, and iii) Jumbo payload.
i) Pad1
This option is designed for alignment purposes.
Some options need to start at a specific bit of the 32-bit word.
Pad1 is added, if one byte is needed for alignment.
ii) PadN
PadN is similar in concept to Pad1.
The difference is that PadN is used when 2 or more bytes are needed for alignment.
iii) Jumbo Payload
This option is used when larger packet has to be sent. (> 65,535 bytes)
Large packets are referred to as jumbo packets.
Maximum length of payload = 65,535 bytes.
2) Destination Option
• This option is used when the source needs to pass information to the destination only.
• Intermediate routers are not allowed to access this information.
• Two options are defined: i) Pad1 & ii) PadN
3) Source Routing
• This option combines the concepts of
→ strict source routing and
→ loose source routing.
4) Fragmentation
• In IPv6, only the original source can fragment.
• A source must use a “Path MTU Discovery technique” to find the smallest MTU along the path from
the source to the destination.
• Minimum size of MTU = 1280 bytes. This value is required for each network connected to the
Internet.
• If a source does not use a Path MTU Discovery technique, the source fragments the datagram to a
size of 1280 bytes.
5) Authentication
• This option has a dual purpose:
i) Validates the message sender: This is needed so the receiver can be sure that a message is
from the genuine sender and not from an attacker.
ii) Ensures the integrity of data: This is needed to check that the data is not altered in transition
by some attacker.
6) Encrypted Security Payload (ESP)
• This option provides confidentiality and guards against attacker.
5-
159
DATA COMMUNICATION
5.9.3.1 Comparison of Options between IPv4 and IPv6
1) The no-operation and end-of-option options in IPv4 are replaced by Pad1 and PadN options
in IPv6.
2) The record route option is not implemented in IPv6 because it was not used.
3) The timestamp option is not implemented because it was not used.
4) The source route option is called the source route extension header in IPv6.
5) The fragmentation fields in the base-header section of IPv4 have moved to the fragmentation
extension header in IPv6.
6) The authentication extension header is new in IPv6.
7) The encrypted security payload extension header is new in IPv6.
5-
160
DATA COMMUNICATION
5.9 THE ICMPv6 PROTOCOL
• ICMP, ARP & IGMP protocols in IPv4 are combined into one single protocol called ICMPv6 (Fig 22.9).
5-
161
DATA COMMUNICATION
5.10.2 Informational Messages
• Two types of messages: i) echo request and ii) echo reply.
• These 2 messages are used to check whether 2 devices can communicate with each other.
• A source-host can send an echo-request message to another host.
The destination-host can respond with the echo-reply message to the source-host.
5-
162
DATA COMMUNICATION
5.10.4 Group Membership Messages
• The management of multicast delivery handling in IPv4 is given to the IGMPv3 protocol.
• In IPv6, this responsibility is given to the Multicast Listener Delivery protocol.
• MLDv2 has 2 types of messages:
1) Membership-query message and
2) Membership-report message.
• The first type can be divided into 3 subtypes: i) General, ii) Group-specific, and iii) Group-and-source
specific.
5-
163
DATA COMMUNICATION
5.10 TRANSITION FROM IPv4 TO IPv6
5.11.1 Strategies
• Three strategies have been devised for transition:
1) Dual stack
2) Tunneling and
3) Header translation.
1) Dual Stack
• Recommended: All hosts must run IPv4 and IPv6 (dual stack) simultaneously until all the Internet
uses IPv6 (Figure 22.11).
3) Header Translation
• Header translation is necessary when the majority of the Internet has moved to IPv6 but some
systems still use IPv4 (Figure 22.13).
• The sender wants to use IPv6, but the receiver does not understand IPv6.
• Tunneling does not work in this situation because
→ the packet must be in the IPv4 format to be understood by the receiver.
• In this case, the header format must be totally changed through header translation.
• The header of the IPv6 packet is converted to an IPv4 header/
5-
164
DATA COMMUNICATION
MODULE-WISE QUESTIONS
MODULE 3: NETWORK LAYER PROTOCOLS
5-
165
DATA COMMUNICATION
MODEL PAPER-1
2a) Explain the theoretical formula which was developed to calculate the data rate. What are the 3
factors on which data rate depends? (10 Marks)
2b) We need to send 265 kbps over a noiseless channel with a bandwidth of 20 kHz. How many signal
levels do we need? (2 Marks)
2c) Explain manchester & differential-manchester encoding schemes. Represent the sequence
101011100 using the same encoding schemes. (4 Marks)
3a) Explain non-uniform quantization & how to recover original signal using PCM decoder. (6 Marks)
3b) An analog signal has a bit rate of 8000 bps & a baud rate of 1000 baud. How many data elements
are carried by each signal element? How many signal elements do we need? (4 Marks)
3c) Describe ASK, FSK and PSK mechanisms and apply them over the digital data 101101. (6 Marks)
4a) What is multiplexing? Explain the FDM multiplexing and demultiplexing process with neat
diagrams. (6 Marks)
4b) Four 1-kbps connections are multiplexed together. A unit is 1 bit. (4 Marks)
Find (i) the duration of 1 bit before multiplexing
(ii) the transmission rate of the link
(iii) the duration of a time slot and
(iv) the duration of a frame.
4c) Explain in detail circuit-switched-network. (6 Marks)
5a) Explain error detection using block coding technique. (10 Marks)
5b) Given the dataword 101001111 and the divisor 10111, show the generation of the CRC codeword
at the sender site. (6 Marks)
6a) Differentiate between character oriented and bit oriented format for framing. (4 Marks)
6b) What is PPP? With a neat diagram, explain the frame structure of PPP. Also, explain framing and
transition phases in PPP. (12 Marks)
7a) Explain reservation access, polling access & token passing access methods. (12 Marks)
7b) List out 5 goals of fast Ethernet. Explain auto-negotiation. (4 Marks)
9a) Explain various components of cellular system with neat diagram. (6 Marks)
9b) Explain the following terms with reference to satellite (4 Marks)
i) Orbits ii) Footprint
9c) Explain various field of IPv4. (6 Marks)
10a) Explain the following term with reference to Mobile IP: (8 Marks)
i) Home address ii) Care-of address iii) Home-agent iv) Foreign-agent
10b) Explain 3 ways to make transition from IPv4 to IPv6. (8 Marks)
5-
166
DATA COMMUNICATION
MODEL PAPER-2
3a) A complex low-pass signal has a bandwidth of 200 kHz. What is the minimum sampling rate for
this signal? (2 Marks)
3b) Explain different aspects of digital-to-analog conversion. (8 Marks)
3c) Define ASK. Explain BASK. (6 Marks)
4a) Five channels, each with a 100-kHz bandwidth, are to be multiplexed together. What is the
minimum bandwidth of the link if there is a need for a guard band of 10 kHz between the channels to
prevent interference? (2 Marks)
4b) Explain in detail synchronous TDM. (8 Marks)
4c) Explain in detail datagram networks. (6 Marks)
5a) Explain checksum with example. Also, write algorithm for Internet Checksum. (12 Marks)
5b) Explain two types of errors. (4 Marks)
6a) Explain HDLC frame format. Also, explain control fields in HDLC. (12 Marks)
6b) Explain the concept of piggybacking. (4 Marks)
10a) What is Mobile IP? Explain three phases for communication in Mobile IP. (8 Marks)
10b) Explain various field of IPv6. (8 Marks)
5-
167
DATA COMMUNICATION
MODEL PAPER-3
7a) Explain pure ALOHA. A pure ALOHA network transmits 200-bit frames on a shared channel of 200
kbps. What is the requirement to make this frame collision-free? (6 Marks)
7b) Explain TDMA & FDMA. (8 Marks)
7c) Explain addressing in standard Ethernet. (2 Marks)
10a) Explain 3 network attacks to IP protocol. Also, explain four services of IPSec. (8 Marks)
10b) Explain various extension header of IPv6. (8 Marks)
5-
168
DATA COMMUNICATION
MODEL PAPER-4
1a) Define data communication. Explain different components of data communication system. Explain
the 3 criteria necessary for an effective and efficient network. (6 Marks)
1b) Define network. Explain in detail WAN. (6 Marks)
1c) Explain different method of accessing the Internet. (4 Marks)
3a) Explain the PCM encoder with neat diagram. (10 Marks)
3b) Define PSK. Explain BPSK. (6 Marks)
5-
169