Nothing Special   »   [go: up one dir, main page]

Computer Network Withtlinks Compressed

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

Cheatsheet

Computer
Networks
Connect with Alumni
Computer Networks

A computer network is a system of interconnected devices that enables


communication and data sharing between them, facilitating resource sharing.

Types of Computer Networks

On the basis of Size On the basis of Connection

Personal Area Network(PAN) Local Area Network(LAN) Wired


Within room Within office or building Uses physical medium to
(Range: 0-100 meter) (Range: upto 2 KM) trasmit the signals.

Campus Area Network(CAN) Local Area Network(LAN) Wireless


Within university or coroprate Within countries Uses air or vaccum as
(Range: 1-5 KM) (Range: Above 50 KM) a transmission medium.

Local Area Network(LAN)


Within cities
(Range: 5-50 KM)

02 Computer Network
2 Network Topologies

Bus Topology Ring Topology

Nodes connected to the single central cable. Nodes connected in a circular fashion.

Simple and inexpensive. Data travels in one direction.

Limited scalability and reliability. Difficult troubleshooting.

Consistent performance.

Star Topology Mesh Topology

HUB

Nodes connected central hub. Every node connects to every other node.

Easy to manage and reliable. Highly reliable but expensive.

Dependency on central hub. Provides redundancy.

Complex to set up and manage.

03 Computer Network
Hybrid Topology

HUB

Combination of two or more different types


of topologies.

Offers advantages of multiple topologies.

Provides flexibility and scalability.

04 Computer Network
3 Network Components and Devices
Devices

Device Name Function

Repeaters Two port device used to re-generate the signal strength.

Hubs It is a multiport repeater.

It is a Two port device used to connect multiple LANs. It also filters the
Bridges
incoming signals.

Switches It is a multiport bridge and a layer two device.

Routers It is a layer three device and used to connect two networks.

It is used to connect and facilitate communication between different types


Gateway
of networks by translating protocols.

It modulate and demodulate analog signals, enabling digital devices to


Modem transmit and receive data over analog communication channels such as
telephone lines or cable

It monitor and control incoming and outgoing network traffic, acting as a


Firewall
barrier between a trusted internal network and untrusted external networks.

A Network Interface Card (NIC) is a hardware component that enables a


NICs
computer to connect to a network and communicate with other devices.

05 Computer Network
Media

Wired Wireless

Ethernet Cables (Twisted Pair): Wireless media refers to the transmission of data
over a network without the use of physical cables,
Cat5e: Common for basic networking.
utilizing radio waves or infrared signals for
Cat6/Cat6a: Higher bandwidth and faster communication.
data transfer.
Cat7/Cat8: Enhanced shielding for even
higher speeds.

Coaxial Cables:
Used for cable television (RG-6) and some
broadband connections. Provides high
bandwidth but less than fiber optics.

Fiber Optic Cables:


Fiber optic cable is a high-speed, transparent,
and flexible medium for transmitting data
using pulses of light, providing faster and more
reliable communication compared to traditional
copper cables.

4 OSI Model
The OSI (Open Systems Interconnection) model is a conceptual framework that
standardizes the functions of a telecommunication or computing system into seven
abstraction layers.

06 Computer Network
This layer provides network services and
interfaces for end-users and applications.
Application Layer It provides services such as file transfers,
email communications, and web
browsing.
Sender

This layer handles data encryption,


compression, and conversion.
Software Layer Presentation Layer
It translates and formats data for proper
presentation to the application layer.

This layer establishes, manages, and


terminates sessions between applications
Session Layer It ensures communication
synchronization, checkpoints, and
recovery.

This layer ensures reliable and error-free


end-to-end data transmission.
Heart of OSI Transport Layer
It manages connection setup,
maintainancne, and termination.

This layer is responsible for routing data


packets between different networks
Network Layer (source to destination).
It is responsible for addressing, logical
network topology, and packet forwarding

This layer provides error-free transmission


of data between adjacent network nodes.
Receiver

It is further divided into two sublayers:


Hardware Layer Data-Link Layer LLC(Logical Link Control) and MAC(Media
Access Control).

It performs functions like framing, error


detection, and flow control.

This layer provides physical data


transmission and transmits raw bit
Physical Layer streams over physical media.
It defines electrical and physical
specifications(cables, connectors, etc.)

07 Computer Network
Data Units of different layers OSI vs TCI/IP

Application Layer Data/Message Application Layer

Presentation Layer Data/Message Presentation Layer Application Layer

Session Layer Data/Message Session Layer

Segment(TCP),
Transport Layer Transport Layer Transport Layer
Datagram(UDP)

Network Layer Packet Network Layer Internet Layer

Data-Link Layer Frame Data-Link Layer


Network Access
Layer
Physical Layer Bit Physical Layer

OSI Model OSI Model TCP/IP Model

5 Switching techniques

Circuit Switching Connection oriented.


Follows Dedicated Path and Blocks Resources.
Entire message is sent together.
One header for the entire message.
Causes Traffic Congestion.
Call Setup Delay.
No loss of information.
Expensive + Easy

08 Computer Network
Message Switching Connection Less Service.
No dedicated path, needs storage at each switch.
Store & Forward Entire message is sent together.
One header for the entire message.
Message Message Reduces Traffic Congestion.
Data Transmission Delay.
No loss of information.
Source
Cost Efficient + Easy
Message Switching Node

Store & Forward

Message Message

Destination

Message Switching Node

Packet Switching

Virtual Circuit Datagram Service

Connection Oriented. Connection Less Service.


Follows Dedicated Path and Blocks Resources. No dedicated path, needs storage at each switch.
Message is broken down into packets. Message is broken down into packets.
Only first packet has Global Header. Global Header in all packets.
Can Cause Traffic Congestion. Reduces Traffic Congestion.
Call Setup & Data Transmission Delay. Data Transmission Delay.
No loss of information. Packets can get lost.
Expensive + Complex Cost Efficient + Easy.

09 Computer Network
06 Networking Protocols

Flow Control Protocol

Flow control protocols are mechanisms used to regulate the flow of data between
sender and receiver to ensure efficient and reliable communication.

Stop and wait Go-Back-N

Stop and Wait ARQ is a flow control protocol Go-Back-N ARQ is a flow control protocol that
that ensures reliable data transmission. The allows the sender to transmit a number of frames
sender sends one data frame at a time and waits without waiting for individual acknowledgments.
for an acknowledgment from the receiver before If an acknowledgment is not received, the sender
sending the next frame. resends all the frames from the last acknowledged
one.

10 Computer Network
Selective Repeat

Selective-Repeat ARQ is a flow control protocol


that allows the sender to transmit a number of
frames without waiting for individual
acknowledgments. If an acknowledgment is not
received, only the specific frame(s) that were
not acknowledged are resent.

Multiple Access Protocols


Multiple Access Protocols are used to allow multiple devices to share a common
communication channel.

Aloha

Start

SET BACK OFF TO


ZERO

WAIT BACK OFF


TIME
SEND THE DATA
NO PACKET

REACHED INCREMENT BACK RECEIVED


LIMIT? OFF ACK
WAIT
YES YES

Abort
SUCCESS
NO

11 Computer Network
Aloha is a random access protocol used in wireless Pure ALOHA allows stations to transmit data at any
networks. Devices can transmit data at any time, time, with collisions resolved after detection, while
but collisions can occur if multiple devices transmit Slotted ALOHA introduces synchronized time slots
simultaneously. It has variants like pure Aloha and for more efficient collision management.
slotted Aloha.

CSMA/CD (Career Sense Multiple


CSMA (Career Sense Multiple Access)
Access/Collision Detection)

Carrier Sense Multiple Access (CSMA) is a multiple Carrier Sense Multiple Access with Collision
access protocol that allows devices to sense the Detection (CSMA/CD) is used in Ethernet networks.
network before transmitting. Transmissions are It adds collision detection to CSMA, and if a collision
deferred if the channel is busy. occurs during transmission, devices stop
transmitting and wait for a random time before
retrying.

CSMA/CA (Career Sense Multiple


Access/Collision Avoidance)

Carrier Sense Multiple Access with Collision


Avoidance (CSMA/CA) is used in wireless networks.
It adds collision avoidance mechanisms to CSMA,
such as Request to Send (RTS) and Clear to Send
(CTS) messages.

Control Access Protocol

Polling

Polling is a communication protocol where a central device (e.g., a server) systematically queries or polls
other devices (e.g., clients) to check for their status or to request information. This protocol is used to
manage and control the flow of data in a network by actively seeking updates from connected devices.

12 Computer Network
Token Passing
Token passing is a network access control method
where a special data packet, known as a "token,"
Station 1 is passed sequentially among nodes in a network.
Only the node possessing the token is granted

To
ke
n
permission to transmit data.

Token passes around the


Station 4 ring from station to station
Station 2

Station 3

Channelization Protocol

FDMA TDMA

Power f
Time
FDMA

Common Channel
Each user allocated
a different subband/
channel.

Frequency t
Data

TDMA stands for Time Division Multiple Access. It is a communication technology used in wireless networks
to allow multiple users to share the same frequency channel by dividing the signal into different time slots.
In TDMA, each user is assigned a specific time slot during which they can transmit or receive data.

13 Computer Network
Routing Algorithm

Routing Protocols are used by routers to determine the best path for data packets to
reach their destination.

Distance Vector (RIP) Link state (OSPF) Path Vector (BGP)

Interior/Exterior Interior Interior Exterior

Default Metric Hop Count Cost (100 MBPS/BW) Multiple Attributes

Convergence Slow Fast Average

Updates Full table Only changes Only changes

Algorithm Bellman-Ford Dijkastra Best Path

TCP vs UDP

Transmisson Control Protocol User Datagram Protocol

Connection oriented. Connection less

Reliable Less Reliable

Error control is mandatory Error control is optional

Slow transmission Fast transmission

More Overhead Less Overhead

14 Computer Network
ARP
Address Resolution Protocol (ARP) maps an IP address to the corresponding MAC
address on a local network. It is used to discover and associate IP and MAC
addresses of devices within a LAN.

IP to MAC Logical to Physical

A X

B Y

C Z

Network 1 Network 2

NAT

Network Address Translation (NAT) is a technique used to translate private IP addresses used within a local
network into a public IP address assigned by the ISP when accessing the internet.

Device A

Device B
Private IP to Public IP Public IP to Private IP
Device C

NAT
Device D Device www

Device E

Device F

Device G

Local Network

15 Computer Network
DNS

Domain Name System (DNS) translates human-readable domain names into IP addresses. It allows users
to access websites using domain names instead of remembering the IP addresses.

www.example.com 12.34.56.78

12.34.56.78

DNS Server Web Server

HTTP/HTTPs FTP DHCP POP3

Hypertext Transfer Protocol File Transfer Protocol (FTP) is Dynamic Host Configuration Post Office Protocol (POP3)
(HTTP) is a protocol used for a protocol used for Protocol (DHCP) automatically is an email protocol used for
transmitting web pages and transferring files between a assigns IP addresses and retrieving emails from a mail
resources over the internet. client and a server on a network configuration details server. It allows users to access
HTTPs is a secure version that network. It provides to devices in a network, and download their emails to
uses encryption to protect functions for file upload, eliminating the need for their devices.
data transmission. download, and management. manual configuration.

IMAP

IMAP, or Internet Message Access Protocol, is a standard email protocol used to retrieve messages from a
mail server. Unlike the older POP (Post Office Protocol), which primarily downloads emails to a local device
and removes them from the server, IMAP allows users to view and manipulate their emails directly on the
mail server

16 Computer Network
07 IP Addressing and Subnetting

IP addressing is the assignment of unique numerical labels (IP addresses) to


devices on a computer network, enabling them to communicate and identify
each other within the Internet Protocol (IP) suite.

IP vs MAC

Feature IP Address MAC Address

Layer Network Layer (Layer 3) Data Link Layer (Layer 2)

Purpose Identifies devices on a network globally Identifies devices on a local network

Hard-coded into the network


Assignment Can be dynamic (DHCP) or static interface by the manufacturer
Unique within a network, routable
Scope Unique within a local network
on the internet
Generally remains constant for
Changes Can change due to network reconfiguration
the device's lifetime
IPV4: 192.168.1.1, IPv6: 00:1A:2B:3C:4D:5E
Examples 2001:0db8:85a3:0000:0000:8a2e:0370:7334 (hexadecimal)

IPV4 Header IPv6 Header

Type of
Version IHL Service Total Length
Version Traffic Class Flow Label
Fragment
Identification Flags Next Hop
Offset Payload Length
Header Limit
TTL Protocol Header Checksum
Source Address
Source Address

Destination Address
Destination Address

Options Padding

17 Computer Network
Version - 4 bits Version - 4 bits
IHL - 4 bits Traffic Class - 8 bits
Type of Service - 8 bits Flow Label - 20 bits
Total Length - 16 bits Payload Length - 16 bits
Identification - 16 bits Next Header - 8 bits
Flags - 3 bits Hop Limit - 8 bits
Fragment Offset - 13 bits Source address - 128 bits
TTL - 8 bits Destination address - 128 bits
Protocol - 8 bits
Header Checksum - 16 bits
Source Address - 32 bits
Destination Address - 32 bits
Options - variable
Padding - variable

IP address classes

Network ID Host ID
Class A

Network ID Host ID
Class B

1 0

Network ID Host ID
Class C

1 1 0

Class D

1 1 1 0

Class E

1 1 1 1

18 Computer Network
Public IP Private IP

A Public IP (Internet Protocol) address is a unique A private IP address is an address reserved for
address assigned to a device connected to a use within a private network and is not routable
network that is accessible from the internet. on the public internet. Private IP addresses are
It allows the device to communicate with other commonly used in local networks, such as homes
devices and services on the internet and is used or businesses, and are typically assigned to
for identifying and routing data packets to the devices like computers, printers, or routers
correct destination. within that network.

Subnetting
Subnetting refers to the practice of dividing a larger network into smaller, more
manageable sub-networks or subnets. Subnetting is commonly done to improve
network performance, enhance security, and efficiently allocate IP addresses.

Subnet Mask
172.16.128.0

Subnet 1 Subnet 2

172.16.00000000.00000000 172.16.10000000.00000000

Fix this bit Fix this bit

Network A
172.16.0.0

19 Computer Network
A subnet mask is a 32-bit numerical value that divides an IP (Internet Protocol) address into network and host
portions. It is used in conjunction with IP addresses to create subnets within a larger network. The subnet
mask contains a series of contiguous 1-bits followed by contiguous 0-bits, with the 1-bits indicating the
network portion and the 0-bits representing the host portion of the address. Subnet masks are essential for
subnetting and help in organizing and managing IP addresses within a network.

8 Network Security
Common network security threats

Masquerading Replay Attack

Original Connection

User A Message from C that appears to be from A User B


User Server

Sniff
Communication MITM Replay

Traffic
User C Hacker

Session Replay Attack

20 Computer Network
Man-In-The-Middle Session Hijacking

Original Connection Session ID=ACF3D35F216AAEFC

User Web Application Victim


Web Server
New Connection

Session ID=ACF3D35F216AAEFC

Perpetrator
Man in the middle Attacker

IDS VPN SSL/TLS

Intrusion Detection Systems are Virtual Private Networks are SSL and TLS are cryptographic
security tools designed to secure, encrypted connections protocols that ensure secure
monitor and analyze network or established over the internet, communication over a computer
system activities for signs of enabling users to access a private network, such as the internet.
unauthorized access, misuse, network from a remote location They establish a secure
or security policy violations. They securely. VPNs protect data connection by encrypting data
generate alerts or take predefined during transmission and provide a during transmission between a
actions when suspicious activities secure communication channel client and a server.
are detected. over the public internet.

09 Points to remember

Remember the helpful acronym "Please Do Not Throw Sausage Pizza Away" to
remember the layers: Physical, Data Link, Network, Transport, Session,
Presentation, and Application.

21 Computer Network
Important Ports in Transport layer

Category Range Ports No. Protocol Protocol

Well Known Ports 0 to 1023 20 TCP FTP data

Registered Ports 1024 to 49151 21 TCP FTP Control

Private Ports 49152 to 65535 22 TCP SSH

25 TCP SMTP

53 UDP, TCP DNS

67,68 UDP DHCP

69 UDP TFTP

80 TCP HTTP

110 TCP POP3

443 TCP SSL

3-way handshake protocol

SYN = 1 FIN = 1

ACK = 1 ACK = 1
SYN = 1 FIN = 1

ACK = 1 ACK = 1

Connection Establishment Connection Termination

22 Computer Network
Miscellaneous

The OSI Model is not commonly used for practical network design and it is widely taught
and serves as an educational tool to understand network communication principles and
concepts.

Devices like routers operate at the Network Layer, switches and bridges at the Data Link
Layer, and hubs, repeaters and modems at the physical Layer.

The bottom layers (1-4) deal with the physical and logical aspects of data transmission,
while the upper layers (5-7) focus on the application and user interface.

Wi-Fi: A widely used wireless technology that allows devices to connect to a local area
network (LAN) or the internet without the need for physical cables. Wi-Fi is commonly
used in homes, businesses, and public spaces.

Cellular Networks: Mobile communication networks that provide wireless connectivity


over a wide area. Technologies like 4G LTE and 5G enable mobile devices to connect to
the internet and communicate with each other.

23 Computer Network

You might also like