Computer Networks Notes-1
Computer Networks Notes-1
BASICS
2. Basic terms:
h. Packet: Packets are used at the network layer of the OSI model. A
packet is a small unit of data transmitted over a network. It contains
both the actual data being sent and the necessary control
information, such as source and destination addresses.
j. Local Host: Local host typically refers to the computer or device you
are currently using. It's often identified by the loopback address
(127.0.0.1), allowing a device to communicate with itself.
k. Bit Rate: Bit rate is the number of bits processed or transmitted in a
unit of time, often measured in bits per second (bps). It represents
the speed of data transfer in a network.
Internet:
Web:
- Definition: The web (or World Wide Web) is a part of the internet
where you access information using websites and web browsers.
- Example: Imagine a book in the library (internet). When you open
the book and read its pages, that's like using a website on the web.
The pages of the book are like different web pages you navigate
through.
7. Network Topology
a. Bus Topology:
All devices share a common communication line (the bus). Data is
sent to all devices, but only the intended recipient processes it.
b. Ring Topology:
Devices are connected circularly. Data travels in one direction,
passing through each device until it reaches the intended recipient.
c. Star Topology:
All devices are connected to a central hub or switch. Data
communication occurs through this central point.
d. Mesh Topology:
Devices are interconnected, and there are multiple paths for data to
travel from one device to another. Offers high redundancy and fault
tolerance.
e. Tree Topology:
A combination of bus and star topologies, forming a hierarchical
structure. Groups of star-configured networks are connected to a
central bus backbone.
Example: Large organizational networks, where individual
departments have their own star topology, connected to a central
bus serving the entire organization.
OSI Model
The Open Systems Interconnect model (OSI Model) explains all the functions
necessary for the Internet to work.
The OSI model is divided into seven different layers, each of which fulfills a
very specific function. When combined, each function contributes to enabling
full computer-to-computer data communication.
1. Physical Layer:
The Physical layer of the OSI model is responsible for the transfer of bits
— the 1’s and 0’s which make up all computer code.
It encompasses the physical medium, like Ethernet cables or Serial Cables.
Despite its name, it includes wireless technologies like WiFi.
Simply put, Layer 1 is anything that carries 1’s and 0’s between two
nodes.
Ethernet uses electric pulses, WiFi uses radio waves, and Fiber uses light
pulses.
Repeaters and Hubs also function at this layer.
Layer 2 will then group together those 1’s and 0’s into chunks known
as Frames.
3. Network Layer
The Network layer of the OSI model is responsible for packet delivery
from end to end.
The IP Header and Data are then further encapsulated in a MAC address
header, which will include information like the Source and Destination
MAC address of the current “hop” in the path towards the final
destination.
Notice between each Router, the MAC address header is stripped and
regenerated to get it to the next hop. The IP header generated by the first
computer is only stripped off by the final computer, hence the IP header
handled the “end to end” delivery, and each of the four different MAC
headers involved in this animation handled the “hop to hop” delivery.
Now, let's extend the analogy to the broader internet. Imagine your
neighborhood is just one of many in a city, and each city is a part of a vast
country. If you want to send a letter to a friend in a different city or
country, you wouldn't just use your house number; you'd need a more
comprehensive address, including the city, state, and country. This is
where IP addresses come in.
Something has to exist in order to distinguish which 1’s and 0’s belong to
the messenger or the browser or the streaming music. That “something”
is Layer 4:
Session layer establishes and maintains the session between the two
users.
6. Presentation Layer
At the sender side, this layer translates the data format used by the
application layer to the common format and at the receiver side, this layer
translates the common format into a format used by the application layer.
7. Application Layer
1. Key Players
2. Host to Host Communication
3. Host to Host through a Switch
4. Host to Host through a Router
5. Final Video
i. hostname: Displays the name of the current host or sets the host
name.
3. What is an API?
a. Modem:
i. A modem is short for modulator-demodulator. In simpler
terms, it connects your home network to the internet service
provider (ISP) by converting digital data from your devices
into a form that can be transmitted over the ISP's network
and vice versa.
b. Router:
i. A router is a device that directs data traffic between different
networks. In a home network, it typically manages the flow of
data between your local devices and the internet.
ii. Routers use a system called Network Address Translation
(NAT) to assign local IP addresses to devices within your
home network, allowing them to share a single public IP
address when accessing the internet.
c. Gateway:
i. A gateway is a device that connects two different networks
and facilitates communication between them. It acts as a
bridge between your local network and the internet.
ii. In the context of home networking, a gateway often combines
the functionality of a modem and a router in a single device. It
serves as the entry point to the internet and manages both
the connection to the ISP and the local network.
9. Private and Public IP addresses.
Security
c. Spoofing Attacks:
Attackers manipulate their identity or IP address to appear as a
trusted entity.
d. Phishing Attacks:
Deceptive attempts to trick individuals into revealing sensitive
information through emails, messages, or websites.
e. SQL Injection:
Exploiting vulnerabilities in web applications to manipulate or gain
unauthorized access to a database.
a. Hash function:
It is a function which converts a plain text into a cipher text. It is
really difficult to convert the cipher text back to plain text.
Eg: MD5 and SHA256.
b. Encryption:
It's like putting a message into a secret language that only those
with the right "key" can understand.
- Symmetric Encryption:
In this type, the same key is used for both the encryption and
decryption of the data.
- Asymmetric Encryption:
Also known as public-key cryptography, it involves a pair of
keys – a public key and a private key. The public key is used
for encryption, while the private key is used for decryption.
4. Process of end-to-end encryption using asymmetric
encryption
a. Key Generation:
i. Both the sender and receiver generate a pair of cryptographic
keys: a public key and a private key.
ii. The public key is shared openly, while the private key is kept
secret.
5. Digital Signatures