0% found this document useful (0 votes)
9 views18 pages

Module 1 CN

Uploaded by

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

Module 1 CN

Uploaded by

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

MODULE 1:

NETWORK COMPONENTS:

OSI LAYERS AND FUNCTIONS:

The OSI (Open Systems Interconnection) model is a conceptual framework used to


understand network interactions in seven distinct layers.

Each layer has its own specific function. Here's a breakdown of each layer and its
corresponding functions:

1. Physical Layer (Layer 1):


o Function: Transmits raw bitstream (0s and 1s) over a physical medium
(cables, radio waves, etc.).
o Responsibilities:
 Defines electrical, mechanical, and procedural aspects for activating,
maintaining, and deactivating physical connections.
 Examples: Cables (Ethernet, fiber optics), wireless signals.
2. Data Link Layer (Layer 2):
o Function: Provides error-free transfer of data frames between nodes on a
network.
o Responsibilities:
 Frames data for transmission.
 Handles error detection and correction.
 Manages access to the physical medium.
 Examples: Ethernet, Wi-Fi, MAC addresses.
3. Network Layer (Layer 3):
o Function: Routes data packets from source to destination across networks.
o Responsibilities:
 Logical addressing (IP addresses).
 Routing and forwarding of data.
 Fragmentation and reassembly of data packets.
 Examples: IP (Internet Protocol), routers, ICMP (used for error
messages like Ping).
4. Transport Layer (Layer 4):
o Function: Provides end-to-end communication and error recovery between
host systems.
o Responsibilities:
 Ensures reliable data transfer (TCP/UDP).
 Flow control and error correction.
 Segmentation and reassembly of data.
 Examples: TCP (Transmission Control Protocol), UDP (User
Datagram Protocol).
5. Session Layer (Layer 5):
o Function: Manages sessions or connections between applications.
o Responsibilities:
 Establishes, maintains, and terminates sessions between applications.
 Synchronization and recovery of data.
 Examples: NetBIOS, RPC (Remote Procedure Call).
6. Presentation Layer (Layer 6):
o Function: Translates data formats and handles encryption and compression.
o Responsibilities:
 Data translation (e.g., converting data formats like EBCDIC to ASCII).
 Encryption and decryption for security.
 Data compression and decompression.
 Examples: SSL/TLS (for encryption), JPEG, GIF, encryption
algorithms.
7. Application Layer (Layer 7):
o Function: Provides network services directly to end-users or applications.
o Responsibilities:
 Interacts directly with software applications to provide communication
services.
 Manages network services like file transfer, email, etc.
 Examples: HTTP (for web browsing), FTP (File Transfer Protocol),
SMTP (for email), DNS.

Bandwidth & Latency

What is Bandwidth?
 Bandwidth refers to the maximum rate of data transfer across a network or internet
connection.
 It is typically measured in bits per second (bps) or its multiples, such as kilobits per second
(kbps) or megabits per second (mbps) for upload and download speed
 Think of bandwidth as the width of a highway: the wider the highway, the more vehicles (data
packets) can travel on it simultaneously, resulting in faster data transmission with high upload
and download speeds
 Bandwidth is crucial for activities like streaming video, online gaming, and downloading
large files.
 A higher bandwidth allows for faster data transfer speeds and smoother, more seamless online

What is Latency?
 Latency, on the other hand, refers to the delay or lag in data transmission over a network.
 It is often measured in milliseconds (ms) and represents the time it takes for a data packet to
travel from the source to the destination and back.
 In simple terms, latency can be compared to the time it takes for a message to travel from one
end of a tunnel to the other and receive a response.

Differences Between Bandwidth and Latency

1. Definition: Bandwidth refers to the data transfer rate, while latency refers to the delay in
data transmission.

2. Measurement: Bandwidth is measured in bits per second, while latency is measured in


milliseconds.
3. Impact on Performance: Bandwidth affects how much data can be transferred at a time,
while latency affects the fastest internet speed at which the data is transmitted.

4. Example: Think of bandwidth as the capacity of a water pipe carrying water, while latency
is the time it takes for the water to reach its destination.

Factors Influencing Bandwidth and Latency


Several factors can influence both bandwidth and latency, including:

 Network Congestion: High traffic can reduce available bandwidth and increase latency.
 Distance: The physical distance between the source and destination can impact both bandwidth and
latency.
 Hardware and Software: The quality of networking equipment and software can affect data
transfer speeds.
 Internet Service Provider (ISP): Different ISPs may offer varying levels of bandwidth and
latency.

Bandwidth X Delay Product

 Bandwidth delay product is a measurement of how many bits can fill up a network link.
 It gives the maximum amount of data that can be transmitted by the sender at a given time
before waiting for acknowledgment.
 Thus it is the maximum amount of unacknowledged data.

Measurement

 Bandwidth delay product is calculated as the product of the link capacity of the channel
and the round – trip delay time of transmission.
 The link capacity of a channel is the number of bits transmitted per second. Hence, its
unit is bps, i.e. bits per second.
 The round – trip delay time is the sum of the time taken for a signal to be transmitted
from the sender to the receiver and the time taken for its acknowledgment to reach the
sender from the receiver. The round – trip delay includes all propagation delays in the
links between the sender and the receiver.
 The unit of bandwidth delay product is bits or bytes.

Example

Consider that the link capacity of a channel is 512 Kbps and round – trip delay time is 1000ms.

The bandwidth delay product = 512 × 103 bits/sec × 1000 × 10−3 sec
= 512,000 bits = 64,000 bytes = 62.5 KB

FRAMING
 In networking, framing refers to the process of breaking down data into
smaller, manageable units (called frames) for transmission across a
network.
 These frames are the basic data units at the data link layer (Layer 2) in the
OSI (Open Systems Interconnection) model.
 The key purpose of framing is to organize the data so that it can be
transmitted efficiently and correctly between devices, with mechanisms
for error detection, synchronization, and control.
Components of a Frame
A typical frame includes several parts:
1. Header: Contains control information for the frame, including addressing
information (like MAC addresses) and type of data.
2. Payload: The actual data being transmitted, often the packet from the
higher layers (like the network layer, Layer 3).
3. Trailer: Contains error-checking information, like a checksum (e.g.,
CRC – Cyclic Redundancy Check), to detect transmission errors.
Purpose of Framing
1. Data Integrity: Frames help detect errors during transmission. The trailer
(e.g., a checksum or CRC) allows the receiver to check if the frame was
transmitted correctly or if it needs to be retransmitted.
2. Addressing: Framing helps identify the source and destination of data.
MAC addresses in the frame header tell where the data is coming from
and where it should go.
3. Flow Control: Frames enable devices to regulate the flow of data
between senders and receivers, ensuring that neither device is
overwhelmed by too much data at once.
4. Synchronization: Framing allows devices to synchronize their
communication by marking the start and end of each frame, ensuring that
they can accurately determine where each frame begins and ends.
Frame Delimiters
One of the most important aspects of framing is knowing where the frame starts
and ends. This is typically done using frame delimiters:
 Byte-Oriented Framing: Uses special byte values (like start or end flags)
to mark the beginning and end of frames.
 Bit-Oriented Framing: Uses specific bit patterns or sequences to mark the
start and end, such as HDLC’s use of "01111110" to denote the start and
end of a frame.
Types of framing
There are two types of framing:
1. Fixed-size: The frame is of fixed size and there is no need to provide
boundaries to the frame, the length of the frame itself acts as a delimiter.
 Drawback: It suffers from internal fragmentation if the data size is less than
the frame size
 Solution: Padding
2. Variable size: In this, there is a need to define the end of the frame as well as
the beginning of the next frame to distinguish. This can be done in two ways:
1. Length field – We can introduce a length field in the frame to indicate the
length of the frame. Used in Ethernet(802.3). The problem with this is that
sometimes the length field might get corrupted.
2. End Delimiter (ED) – We can introduce an ED(pattern) to indicate the end of
the frame. Used in Token Ring. The problem with this is that ED can occur in
the data. This can be solved by:
1. Character/Byte Stuffing: Used when frames consist of characters. If data
contains ED then, a byte is stuffed into data to differentiate it from ED.
Let ED = “$” –> if data contains ‘$’ anywhere, it can be escaped using ‘\O’
character.
–> if data contains ‘\O$’ then, use ‘\O\O\O$'($ is escaped using \O and \O is
escaped using \O).
PPP (POINT TO POINT PROTOCOL) FRAMING
 Point-to-Point Protocol (PPP) is generally the default RAS protocol
in Windows and is most commonly used protocol of data link layer that is
required to encapsulate higher network-layer protocols simply to pass over
synchronous and asynchronous communication lines.
 In PPP, link establishment is controlled and handled mainly by Link
Control Protocol (LCP).

PPP Frame Format : PPP frame is generally required to encapsulate packets of


information or data that simply includes either configuration information or data.
PPP basically uses the same basic format as that of HDLC. PPP usually contains
one additional field i.e. protocol field. This protocol field is present just after
control field and before information or data field.
Various fields of Frame are given below :
1. Flag field – PPP frame similar to HDLC frame, always begins and ends with
standard HDLC flag. It always has a value of 1 byte i.e., 01111110 binary
value.
2. Address field – Address field is basically broadcast address. In this, all 1’s
simply indicates that all of the stations are ready to accept frame. It has the
value of 1 byte i.e., 11111111 binary value. PPP on the other hand, does not
provide or assign individual station addresses.
3. Control field – This field basically uses format of U-frame i.e., Unnumbered
frame in HDLC. In HDLC, control field is required for various purposes but in
PPP, this field is set to 1 byte i.e., 00000011 binary value. This 1 byte is used
for a connection-less data link.
4. Protocol field – This field basically identifies network protocol of the
datagram. It usually identifies the kind of packet in the data field i.e., what
exactly is being carried in data field. This field is of 1 or 2 bytes and helps in
identifies the PDU (Protocol Data Unit) that is being encapsulated by PPP
frame.
5. Data field – It usually contains the upper layer datagram. Network layer
datagram is particularly encapsulated in this field for regular PPP data frames.
Length of this field is not constant rather it varies.
6. FCS field – This field usually contains checksum simply for identification of
errors. It can be either 16 bits or 32 bits in size. It is also calculated over
address, control, protocol, and even information fields. Characters are added
to frame for control and handling of errors.
Frame Structure of HDLC

High-Level Data Link Control (HDLC) generally uses term “frame” to indicate
and represent an entity of data or a protocol of data unit often transmitted or
transferred from one station to another station. Each and every frame on link
should begin and end with Flag Sequence Field (F). Each of frames in HDLC
includes mainly six fields. It begins with a flag field, an address field, a control
field, an information field, an frame check sequence (FCS) field, and an ending
flag field. The ending flag field of one frame can serve as beginning flag field of
the next frame in multiple-frame transmissions.
The basic frame structure of HDLC protocol is shown below:
Size of Different Fields:

Field Name Size (bits)

Flag Field 8 bits

Address Field 8 bits

Control Field 8 or 16 bits

Variable (not used in some type


Information Field
of HDLC frames)

FCS (Frame Check


16 or 32 bits
Sequence) Field

Closing Flag Field 8 bits

1. Flag Field –
The flag field is generally responsible for initiation and termination of error
checking. In HDLC protocol, there is no start and stop bits. So, the flag field
is basically using delimiter 0x7e to simply indicate beginning and end of
frame.
It is an 8-bit sequence with a bit pattern 01111110 that basically helps in
identifying both starting and end of a frame. This bit pattern also serves as a
synchronization pattern for receiver. This bit pattern is also not allowed to
occur anywhere else inside a complete frame.

2. Address Field –
The address field generally includes HDLC address of secondary station. It
helps to identify secondary station will sent or receive data frame. This field
also generally consists of 8 bits therefore it is capable of addressing 256
addresses. This field can be of 1 byte or several bytes long, it depends upon
requirements of network. Each byte can identify up to 128 stations.
This address might include a particular address, a group address, or a
broadcast address. A primary address can either be a source of communication
or a destination that eliminates requirement of including address of primary.

3. Control Field –
HDLC generally uses this field to determine how to control process of
communication. The control field is different for different types of frames in
HDLC protocol. The types of frames can be Information frame (I-frame),
Supervisory frame (S-frame), and Unnumbered frame (U-frame).

This field is a 1-2-byte segment of frame generally requires for flow and error
control. This field basically consists of 8 bits but it can be extended to 16 bits.
In this field, interpretation of bits usually depends upon the type of frame.

4. Information Field –
This field usually contains data or information of users sender is transmitting
to receiver in an I-frame and network layer or management information in U-
frame. It also consists of user’s data and is fully transparent. The length of this
field might vary from one network to another network.
Information field is not always present in an HDLC frame.

5. Frame Check Sequence (FCS) –


FCS is generally used for identification of errors i.e., HDLC error detection.
In FCS, CRC16 (16-bit Cyclic Redundancy Check) or CRC32 (32-bit Cyclic
Redundancy Check) code is basically used for error detection. CRC
calculation is done again in receiver. If somehow result differs even slightly
from value in original frame, an error is assumed.
This field can either contain 2 byte or 4 bytes. This field is a total 16 bit that is
required for error detection in address field, control field, and information
field. FCS is basically calculated by sender and receiver both of a data frame.
FCS is used to confirm and ensure that data frame was not corrupted by
medium that is used to transfer frame from sender to receiver.
Synchronous Optical Network (SONET)

 SONET is a standardized digital communication protocol developed by


Bellcore.
 Using optical fiber, SONET is used to transmit a large volume of data over
relatively long distances.
 It allows multiple digital data streams to be transferred simultaneously
over the same optical fiber using LEDs and laser beams.

SONET Network Elements

 STS Multiplexer:
o Performs multiplexing of signals
o It Converts electrical signal to optical signal
 STS Demultiplexer:
o Performs demultiplexing of signals
o It Converts optical signal to electrical signal
 Regenerator:
o It is a repeater, that takes an optical signal and regenerates (increases
the strength) it.
 Add/Drop Multiplexer:
o It allows to add signals coming from different sources into a given
path or remove a signal.
SONET Layers

 Path Layer:
o It is responsible for the movement of signals from its optical source
to its optical destination.
o STS Mux/Demux provides path layer functions.
 Line Layer:
o It is responsible for the movement of signal across a physical line.
o STS Mux/Demux and Add/Drop Mux provides Line layer functions.

 Section Layer:
o It is responsible for the movement of signal across a physical
section.
o Each device of network provides section layer functions.
 Photonic Layer:
o It corresponds to the physical layer of the OSI model.
o It includes physical specifications for the optical fibre channel
(presence of light = 1 and absence of light = 0).

Advantages of SONET

 Transmits data to large distances


 Low electromagnetic interference
 High data rates
 Large Bandwidth
Error Detection in Computer Networks
 Error is a condition when the receiver’s information does not match the
sender’s.
 Digital signals suffer from noise during transmission that can introduce
errors in the binary bits traveling from sender to receiver.
 That means a 0 bit may change to 1 or a 1 bit may change to 0.
 Data (Implemented either at the Data link layer or Transport Layer of the
OSI Model) may get scrambled by noise or get corrupted whenever a
message is transmitted.
 To prevent such errors, error-detection codes are added as extra data to
digital messages.
 This helps in detecting any errors that may have occurred during message
transmission.
Types of Errors
Single-Bit Error
A single-bit error refers to a type of data transmission error that occurs when one
bit (i.e., a single binary digit) of a transmitted data unit is altered during
transmission, resulting in an incorrect or corrupted data unit.

Single-Bit Error

Multiple-Bit Error
A multiple-bit error is an error type that arises when more than one bit in a data
transmission is affected. Although multiple-bit errors are relatively rare when
compared to single-bit errors, they can still occur, particularly in high-noise or
high-interference digital environments.

Multiple-Bit Error

Burst Error
When several consecutive bits are flipped mistakenly in digital transmission, it
creates a burst error. This error causes a sequence of consecutive incorrect values.

Burst Error

Error Detection Methods

To detect errors, a common technique is to introduce redundancy bits that provide


additional information. Various techniques for error detection include:
 Simple Parity Check
 Two-Dimensional Parity Check
 Checksum
 Cyclic Redundancy Check (CRC)
Simple Parity Check
Simple-bit parity is a simple error detection method that involves adding an extra
bit to a data transmission. It works as:
 1 is added to the block if it contains an odd number of 1’s, and
 0 is added if it contains an even number of 1’s
This scheme makes the total number of 1’s even, that is why it is called even
parity checking.

Advantages of Simple Parity Check


 Simple parity check can detect all single bit error.
 Simple parity check can detect an odd number of errors.
 Implementation: Simple Parity Check is easy to implement in both hardware
and software.
 Minimal Extra Data: Only one additional bit (the parity bit) is added per data
unit (e.g., per byte).
 Fast Error Detection: The process of calculating and checking the parity bit
is quick, which allows for rapid error detection without significant delay in
data processing or communication.
 Single-Bit Error Detection: It can effectively detect single-bit errors within a
data unit, providing a basic level of error detection for relatively low-error
environments.

Two-Dimensional Parity Check

Two-dimensional Parity check bits are calculated for each row, which is
equivalent to a simple parity check bit. Parity check bits are also calculated for all
columns, then both are sent along with the data. At the receiving end, these are
compared with the parity bits calculated on the received data.
Advantages of Two-Dimensional Parity Check
 Two-Dimensional Parity Check can detect and correct all single bit error.
 Two-Dimensional Parity Check can detect two or three bit error that occur any
where in the matrix.

Checksum
Checksum error detection is a method used to identify errors in transmitted data.
The process involves dividing the data into equally sized segments and using
a 1’s complement to calculate the sum of these segments. The calculated sum is
then sent along with the data to the receiver. At the receiver’s end, the same
process is repeated and if all zeroes are obtained in the sum, it means that the data
is correct.
Checksum – Operation at Sender’s Side
 Firstly, the data is divided into k segments each of m bits.
 On the sender’s end, the segments are added using 1’s complement arithmetic
to get the sum. The sum is complemented to get the checksum.
 The checksum segment is sent along with the data segments.
Checksum – Operation at Receiver’s Side
 At the receiver’s end, all received segments are added using 1’s complement
arithmetic to get the sum. The sum is complemented.
 If the result is zero, the received data is accepted; otherwise discarded.
Cyclic Redundancy Check (CRC)

 Unlike the checksum scheme, which is based on addition, CRC is based


on binary division.
 In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are
appended to the end of the data unit so that the resulting data unit becomes
exactly divisible by a second, predetermined binary number.
 At the destination, the incoming data unit is divided by the same number. If at
this step there is no remainder, the data unit is assumed to be correct and is
therefore accepted.
 A remainder indicates that the data unit has been damaged in transit and
therefore must be rejected.
CRC
Working
We have given dataword of length n and divisor of length k.
Step 1: Append (k-1) zero’s to the original message
Step 2: Perform modulo 2 division
Step 3: Remainder of division = CRC
Step 4: Code word = Data with append k-1 zero’s + CRC
Note:
 CRC must be k-1 bits
 Length of Code word = n+k-1 bits
Example: Let’s data to be send is 1010000 and divisor in the form of polynomial
is x3+1. CRC method discussed below.

You might also like