Uploaded by Pranav Chopra

Computer-Network Notes Basic Theory

advertisement
Computer Network Notes
Unit: 1
Data Communications:
Data Communications is a critical aspect of modern technology, enabling the transfer of data
between various devices and systems. In this comprehensive guide, we will cover key aspects
of Data Communications, including its components, networks, the Internet, protocols, and
standards.
Data Communications Components
1. Data: Data can be in the form of text, numbers, images, audio, or video. It is the information
that needs to be transmitted.
2. Transmitter: The sender device that initiates the data transmission process. It converts
data into a suitable format for transmission.
3. Receiver: The recipient device that receives and decodes the transmitted data, making it
usable.
4. Transmission Medium: The physical path through which data is transmitted. This can be
wired (e.g., copper, fiber-optic cables) or wireless (e.g., radio waves).
5. Protocol: A set of rules that govern how data is transmitted and received. It defines the
format of data, error handling, and more.
Data Communications Networks
1. Local Area Network (LAN): A network that covers a limited geographical area, such as a
home, office, or campus. LANs typically use Ethernet technology.
2. Wide Area Network (WAN): A network that covers a larger geographic area, often
connecting LANs. The Internet is an example of a global WAN.
3. Metropolitan Area Network (MAN): A network that spans a city or a large campus.
4. Backbone Network: The central network that connects various LANs and WANs. It
ensures data can flow across the entire network.
5. Intranet: A private network within an organization, accessible only to its members.
6. Extranet: A network that allows controlled access to certain outsiders, such as business
partners.
The Internet
1. Internet Service Provider (ISP): Companies that provide access to the Internet. They
connect users to the global network.
2. World Wide Web (WWW): A system of interconnected documents and resources on the
Internet, accessible via web browsers.
3. IP Address: A unique numerical label assigned to each device connected to a network. It's
essential for routing data.
4. Domain Name System (DNS): Translates human-readable domain names (e.g.,
google.com) into IP addresses.
5. Web Servers: Computers that store and serve web content to users.
6. HTTP and HTTPS: Protocols for transferring web data. HTTPS is secure and encrypted.
Protocols and Standards
1. Transmission Control Protocol (TCP): Ensures reliable, error-free data transmission by
breaking data into packets and verifying their delivery.
2. Internet Protocol (IP): Handles addressing and routing of data packets across networks.
3. Ethernet: A common LAN protocol that defines how data packets are formatted and
transmitted over LANs.
4. Wi-Fi (802.11): Wireless networking standards that enable devices to connect to the
Internet without physical cables.
5. HTTP/HTTPS: Hypertext Transfer Protocol for web communication. HTTPS adds security
through encryption.
6. POP and IMAP: Protocols for email communication, allowing retrieval of messages from
servers.
Network Models:
Network Models are essential for understanding how data communication occurs in computer
networks. In this comprehensive guide, we will delve into the OSI Model, TCP/IP Protocol Suite,
compare these models, and discuss addressing in networking.
OSI Model (Open Systems Interconnection Model)
The OSI Model is a conceptual framework that standardizes the functions of a
telecommunication or computing system into seven distinct layers. It aids in understanding how
different networking protocols work together.
1. Physical Layer: This layer deals with the physical medium and transmission of raw bits
over a network. It includes hardware components like cables, switches, and network
interfaces.
2. Data Link Layer: Responsible for the reliable transmission of data frames over a physical
medium. It includes MAC (Media Access Control) and LLC (Logical Link Control) sublayers.
3. Network Layer: Handles routing and logical addressing. The Internet Protocol (IP)
operates at this layer, ensuring data is correctly addressed and routed.
4. Transport Layer: Manages end-to-end communication, ensuring data is delivered reliably.
TCP and UDP protocols are part of this layer.
5. Session Layer: Manages sessions or connections between devices. It establishes,
maintains, and terminates connections.
6. Presentation Layer: Responsible for data translation, encryption, and compression. It
ensures that data is presented in a readable format.
7. Application Layer: The topmost layer where user applications and services interact with
the network. Examples include HTTP, FTP, and SMTP.
TCP/IP Protocol Suite
The TCP/IP Protocol Suite is the foundation of the Internet. It's a set of protocols that allow
computers to communicate over networks. It doesn't strictly adhere to the OSI Model but can be
mapped to it.
1. Link Layer: Combines functions of the OSI Physical and Data Link Layers, dealing with the
physical medium and data frame transmission.
2. Internet Layer: Comparable to the OSI Network Layer, it handles addressing, routing, and
packet forwarding. IP is the primary protocol.
3. Transport Layer: Corresponds to the OSI Transport Layer. TCP provides reliable,
connection-oriented communication, while UDP offers lightweight, connectionless transport.
4. Application Layer: A combination of OSI Session, Presentation, and Application Layers. It
includes a wide range of protocols for various applications and services.
A Comparison of OSI and TCP/IP Reference Models
The OSI Model is a theoretical model with seven layers, while TCP/IP has fewer layers and
is more practical for real-world use.
OSI is a comprehensive framework, but TCP/IP is widely adopted due to its simplicity and
compatibility with the Internet.
The TCP/IP Internet Layer combines functions of the OSI Network and Data Link Layers.
OSI Model has a clear separation between each layer's functions, while TCP/IP's layer
functions often overlap.
Addressing
IP Address: In both models, IP addresses are used for identifying devices on a network.
IPv4 uses 32-bit addresses, while IPv6 uses 128-bit addresses.
MAC Address: This is a hardware address unique to each network interface card (NIC)
and is used at the Data Link Layer for local network communication.
Port Number: Ports are used in the Transport Layer to specify different services on a
single device. For example, HTTP uses port 80, while HTTPS uses port 443.
Physical Layer:
The Physical Layer is the first layer in the OSI model and plays a crucial role in transmitting raw
data bits over a physical medium. It involves various concepts, including signal types,
transmission modes, transmission media, and error detection and correction codes.
Analog and Digital Signals
1. Analog Signals: Analog signals are continuous and can take any value within a range.
They are often used in scenarios where data is represented as varying voltage or current
levels. Examples include audio signals and traditional phone lines.
2. Digital Signals: Digital signals are discrete and can only take on specific values (0 or 1).
They are commonly used in modern digital communication systems, including computer
networks. Digital signals are less susceptible to noise and distortion.
Transmission Modes
1. Simplex: In simplex mode, data flows in only one direction, from sender to receiver.
Examples include television broadcasts and keyboard input.
2. Half-Duplex: In half-duplex mode, data can flow in both directions, but not simultaneously.
Users take turns transmitting and receiving data. Walkie-talkies are an example.
3. Full-Duplex: Full-duplex mode allows simultaneous two-way communication. This is typical
in most computer networks and telephone conversations.
Transmission Media
1. Guided Media: Guided media use physical cables or wires to transmit signals. Examples
include:
Twisted Pair Cable: Common in Ethernet connections.
Coaxial Cable: Used in cable TV and broadband.
Fiber-Optic Cable: Offers high-speed, long-distance transmission.
2. Unguided Media: Unguided media transmit signals through the air or space without a
physical connection. Examples include:
Radio Waves: Used in Wi-Fi and cellular networks.
Microwaves: Employed for point-to-point communication.
Infrared: Used in remote controls and short-range data transfer.
Error Detection and Correction Codes
1. Error Detection: Techniques used to identify errors in transmitted data. Common methods
include:
Parity Bit: Adding an extra bit to make the number of 1s even (even parity) or odd
(odd parity).
Checksums: A sum or hash of data bits that is checked for consistency.
2. Error Correction: Methods that not only detect but also correct errors. Examples include:
Hamming Code: Corrects single-bit errors and detects double-bit errors.
Reed-Solomon Code: Used in data storage and transmission, correcting multiple
errors.
Circuit Switching:
Switching is a fundamental concept in networking, determining how data is routed and
transmitted. It involves different techniques, each with its own characteristics. In this guide, we
will cover Circuit switching (space-division, time division, and space-time division), Packet
switching (virtual circuit and Datagram approach), and Message switching.
Circuit switching is an older technology used in traditional telephone networks. It establishes a
dedicated communication path for the entire duration of the conversation.
1. Space-Division Switching: In space-division switching, multiple communication paths
(channels) are created using physical switches or wires. Each path is reserved for a single
communication.
2. Time-Division Switching: Time-division switching divides time into fixed intervals or time
slots. Different conversations take turns using the same channel by utilizing their
designated time slots.
3. Space-Time Division Switching: This combines space-division and time-division
switching. It allocates specific channels for specific time intervals, optimizing network
usage.
Packet Switching
Packet switching is the basis for modern data networks, including the Internet. Data is broken
into packets, and these packets are individually routed to their destination.
1. Virtual Circuit Approach: This approach emulates a dedicated path by establishing a
logical connection. Each packet is marked with a circuit ID, allowing routers to forward
packets along the same path.
2. Datagram Approach: In the Datagram approach, each packet is treated independently.
Routers make routing decisions for each packet based on the current network conditions.
This approach is more flexible but can lead to varying delay and out-of-order packet
delivery.
Message Switching
Message switching is an older and less common technique. Instead of dividing data into
packets, complete messages are transmitted as a whole. Each message is stored and
forwarded from one node to the next until it reaches its destination.
Message switching is slower compared to packet switching, as it requires the entire
message to be received before forwarding.
It was often used in early telegraph networks and legacy systems.
Key Differences
Circuit switching establishes a dedicated path for communication, while packet switching
breaks data into packets and routes them individually.
Packet switching is more efficient and flexible, suitable for data networks, while circuit
switching is less flexible but suitable for voice communication.
The virtual circuit approach in packet switching offers a compromise between circuit and
packet switching.
Unit: 2
Data Link Layer:
The Data Link Layer, the second layer in the OSI model, is responsible for reliable point-to-point
and point-to-multipoint communication over a physical medium. In this guide, we will discuss
design issues and Data Link Control, which are critical aspects of this layer.
Data Link Layer Design Issues
1. Framing: Framing involves the creation of frames that mark the beginning and end of data
packets. It helps receivers identify and extract the data. Two common framing techniques
are character count and start-stop flags.
2. Error Detection and Correction: Ensuring data integrity is vital. Error detection techniques
like checksums and cyclic redundancy checks (CRC) are used to identify errors. Error
correction methods like Automatic Repeat Request (ARQ) may be applied.
3. Flow Control: Flow control mechanisms prevent data overflow between the sender and
receiver. Techniques like stop-and-wait and sliding window control the rate of data
transmission.
4. Addressing: Each device on a network needs a unique address. In Ethernet, for instance,
MAC (Media Access Control) addresses are used for this purpose.
5. Access Control: In shared media networks, devices must contend for access to the
medium. Protocols like Carrier Sense Multiple Access (CSMA) help manage access fairly.
6. Data Link Layer Protocols: Specific protocols such as Ethernet, Point-to-Point Protocol
(PPP), and High-Level Data Link Control (HDLC) are used in this layer.
Data Link Control
Data Link Control is a sublayer within the Data Link Layer responsible for managing
communication between two directly connected devices.
1. Error Control: Data Link Control implements error detection and correction techniques. If
errors are detected, the protocol may request retransmission of the corrupted frame.
2. Flow Control: Flow control mechanisms ensure that data is transmitted at a rate that the
receiving device can handle. This prevents data loss due to buffer overflows.
3. Framing: The framing process helps the receiver identify the beginning and end of a data
frame. Start-stop flags, character counts, and flags are commonly used for this purpose.
4. Addressing: Devices are identified using unique addresses, such as MAC addresses in
Ethernet networks.
5. Access Control: In shared media networks, Data Link Control manages access to the
medium. Protocols like CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
are used in Ethernet networks.
Key Considerations
Data Link Control is essential for managing point-to-point and point-to-multipoint
communication in a network.
It ensures data integrity, flow control, addressing, and access control to enable reliable data
transmission.
Data Link Layer protocols may vary depending on the network type and technology.
Protocols:
Protocols are the foundation of communication in computer networks. They dictate how data is
transmitted and received, ensuring reliability and efficiency. In this guide, we will discuss key
protocols, including Flow and Error Control, Stop-and-Wait ARQ, Sliding Window Protocol, GoBack-N ARQ, Selective Repeat ARQ, and HDLC.
Flow and Error Control
Flow and error control are critical aspects of reliable data transmission in networks.
Flow Control: Flow control mechanisms ensure that data is sent at a rate that the receiver
can handle, preventing buffer overflows and data loss. Common techniques include stopand-wait and sliding window control.
Error Control: Error control ensures data integrity by detecting and, in some cases,
correcting errors. Techniques include checksums, cyclic redundancy checks (CRC), and
Automatic Repeat Request (ARQ) protocols.
Stop-and-Wait ARQ
Stop-and-Wait Automatic Repeat reQuest (ARQ) is a simple ARQ protocol.
Sender: The sender sends a single frame and waits for an acknowledgment (ACK) from
the receiver. If an ACK is not received, the sender resends the frame.
Receiver: The receiver acknowledges frames it receives. If a frame is received out of order
or with errors, it is discarded.
This protocol is straightforward but can be inefficient due to the waiting time between
transmissions.
Sliding Window Protocol
Sliding Window protocols enhance network efficiency by allowing multiple frames to be in transit
simultaneously.
Sender: The sender can send multiple frames without waiting for individual
acknowledgments. It maintains a sending window that slides as acknowledgments are
received.
Receiver: The receiver maintains a receiving window that slides as frames are received. It
acknowledges frames within the window.
Sliding Window protocols, such as Go-Back-N and Selective Repeat, improve network
throughput.
Go-Back-N ARQ
Go-Back-N ARQ is a specific sliding window ARQ protocol.
Sender: The sender can send multiple frames before waiting for acknowledgments. If a
frame is not acknowledged, all subsequent frames are retransmitted.
Receiver: The receiver discards out-of-order frames and acknowledges correctly received
frames.
This protocol simplifies the receiver but can result in the retransmission of unnecessary
frames.
Selective Repeat ARQ
Selective Repeat ARQ is another sliding window ARQ protocol.
Sender: The sender can send multiple frames before waiting for acknowledgments. If a
frame is not acknowledged, only that frame is retransmitted.
Receiver: The receiver buffers out-of-order frames and acknowledges correctly received
frames.
Selective Repeat is more complex but minimizes unnecessary retransmissions.
HDLC (High-Level Data Link Control)
High-Level Data Link Control (HDLC) is a widely used Data Link Layer protocol.
HDLC defines frame structures, addressing, and control sequences for error control and
flow control.
It supports various operational modes, including Normal Response Mode (NRM) and
Asynchronous Response Mode (ARM).
HDLC is a precursor to many other data link protocols, including SDLC (Synchronous Data
Link Control) and Frame Relay.
Key Considerations
Flow and error control are essential for ensuring reliable data transmission.
Stop-and-Wait ARQ is simple but not very efficient.
Sliding Window protocols like Go-Back-N and Selective Repeat improve network
throughput.
HDLC is a versatile data link protocol with various operational modes.
Point-to –Point Access:
Point-to-Point (PPP) access is a critical aspect of computer networking, particularly in scenarios
where direct connections are established between two devices. In this guide, we will explore
Point-to-Point Protocol (PPP) and the PPP stack.
Point-to-Point Protocol (PPP)
Point-to-Point Protocol (PPP) is a widely used data link protocol that establishes a direct
connection between two devices, enabling data transmission between them. It is often
employed in dial-up connections, broadband, and WAN links.
Key Features and Components of PPP:
1. Frame Structure: PPP frames consist of a header, data field, and trailer. The header and
trailer provide addressing and error-checking mechanisms.
2. Link Control Protocol (LCP): LCP is responsible for establishing, configuring, and
terminating the data link connection. It negotiates link options such as authentication,
compression, and error detection.
3. Authentication Protocols: PPP supports various authentication protocols, including PAP
(Password Authentication Protocol) and CHAP (Challenge Handshake Authentication
Protocol). These protocols ensure secure authentication between the devices.
4. Network Control Protocols (NCP): NCPs are responsible for configuring network-layer
protocols. For example, IPCP (Internet Protocol Control Protocol) configures the IP
addresses on the connection.
5. Error Detection and Correction: PPP employs CRC (Cyclic Redundancy Check) for error
detection, and error correction is handled at higher layers if needed.
6. Compression: Data compression can be used to optimize the use of the connection,
reducing the amount of data transmitted.
7. Multilink PPP: MLP allows the aggregation of multiple physical connections to create a
single logical link, increasing bandwidth and reliability.
PPP Stack
The PPP stack represents the various layers of the PPP protocol suite. It operates at the Data
Link Layer and is designed for point-to-point connections.
1. PPP Data Link Layer (DLL): This layer is responsible for framing data and managing the
link between the devices.
2. Link Control Protocol (LCP): LCP operates above the Data Link Layer and handles link
establishment, configuration, and termination.
3. Authentication Protocols: These protocols handle authentication between the devices.
PAP and CHAP are common examples.
4. Network Control Protocols (NCP): NCPs configure network-layer protocols, such as IP
addresses through IPCP.
5. Compression Protocols: These protocols optimize data transmission by reducing the
amount of data sent over the link.
6. Error Detection and Correction: Error detection is achieved through CRC, and error
correction is managed at higher layers when required.
7. Multilink PPP (MLP): MLP aggregates multiple physical connections into a single logical
link, enhancing bandwidth and reliability.
Key Considerations
PPP is commonly used for point-to-point connections, such as dial-up and broadband
connections.
It provides features like authentication, error detection, and compression, making it suitable
for various network scenarios.
The PPP stack comprises several protocols that work together to establish and manage the
data link.
Medium Access Sub layer:
The Medium Access Sublayer (MAC) is a crucial component of the Data Link Layer in
networking. It deals with how multiple devices access and share a common communication
medium. In this guide, we will delve into various aspects of the MAC sublayer, including the
channel allocation problem, controlled access, channelization, multiple access protocols, IEEE
standards 802.3 and 802.11 for LANs and WLANs, high-speed LANs, Token Ring, Token Bus,
FDDI-based LANs, and network devices like repeaters, hubs, switches, and bridges.
Channel Allocation Problem
The channel allocation problem deals with how to manage access to a shared communication
medium efficiently, minimizing collisions and ensuring fair access among devices.
Frequency Division Multiplexing (FDM) and Time Division Multiplexing (TDM) are
traditional techniques used to allocate channels.
In data networks, shared access methods are employed, where multiple devices contend
for the same channel.
Controlled Access
Controlled access methods provide a structured way for devices to access the medium.
Common approaches include:
Reservation-based Access: Devices request permission before transmitting, as seen in
Token Ring networks.
Polling: A central controller polls devices to determine when they can transmit.
Collision Detection: Devices listen for a clear channel and transmit when they detect no
ongoing transmissions, as used in Ethernet networks.
Channelization
Channelization involves dividing the available bandwidth into smaller channels, each dedicated
to specific communication.
In wireless networks, channels are created by dividing the frequency spectrum into nonoverlapping bands.
In wired networks, channels can be implemented through time division or frequency division
techniques.
Multiple Access Protocols
Multiple access protocols define how devices contend for access to a shared medium.
CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is used in Ethernet
to detect and resolve collisions.
CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) is used in Wi-Fi
networks to reduce the chances of collisions.
Token Passing: A token circulates among devices, granting the right to transmit.
IEEE Standards 802.3 & 802.11
IEEE 802.3 (Ethernet): A widely used LAN standard with variants like 10BASE-T,
100BASE-TX, and 1000BASE-T. It uses CSMA/CD for access.
IEEE 802.11 (Wi-Fi): A standard for wireless LANs, with different versions like 802.11a,
802.11n, and 802.11ac. It uses CSMA/CA.
High-Speed LANs
High-speed LANs are designed for increased data transmission rates. Fiber-optic cables, gigabit
Ethernet, and technologies like 10 Gigabit Ethernet (10GbE) are used to achieve high-speed
LAN connections.
Token Ring, Token Bus, FDDI-based LANs
Token Ring: A LAN technology where devices transmit data when they possess a token,
ensuring orderly access to the medium.
Token Bus: Similar to Token Ring, but devices share a logical bus rather than a physical
ring.
Fiber Distributed Data Interface (FDDI): A high-speed LAN technology using a dual-ring
architecture for redundancy.
Network Devices: Repeaters, Hubs, Switches, Bridges
Repeaters: Devices that regenerate and amplify signals to extend the reach of a network.
Hubs: Passive devices that connect multiple network segments, simply forwarding data to
all connected devices.
Switches: Active devices that intelligently forward data to specific devices based on MAC
addresses, improving network efficiency.
Bridges: Devices that connect two or more network segments, filtering and forwarding data
based on MAC addresses to reduce network traffic.
Key Considerations
The MAC sublayer is essential for managing access to shared communication mediums.
Multiple access protocols like CSMA/CD, CSMA/CA, and token passing enable efficient
sharing.
IEEE standards like 802.3 and 802.11 provide guidelines for LAN and WLAN
communication.
Download