Almost All About Networking! - Codelivly
Almost All About Networking! - Codelivly
com
@codelivly
Swipe...
2
www.codelivly.com
WHAT IS NETWORKING?
TYPES OF NETWORKS
1. Local Area Network (LAN)
A LAN is a network that connects devices within a small geographic area, like
a home, office, or school.
For example, your home Wi-Fi network connects your smartphone, laptop,
and smart TV.
Features:
High speed: Typically very fast, as devices are close together.
Limited range: Covers a small area, usually within a few hundred
meters.
Common use: File sharing, gaming, and printer access.
A WAN connects multiple LANs over a large geographic area, often using
leased telecommunication lines.
For example, the internet itself is the largest WAN, connecting millions
of networks globally.
Features:
Long distance: Covers large areas, even continents.
Lower speed: Generally slower than LANs due to the distance and
the technology used.
Common use: Connecting branch offices of a company or
providing internet access.
4
www.codelivly.com
TYPES OF NETWORKS
3. Metropolitan Area Network (MAN)
A MAN covers a larger geographic area than a LAN but is smaller than a
WAN, typically serving a city or a large campus.
For example the network used by a city to connect government
buildings and public services.
Features:
Medium range: Typically spans 5 to 50 kilometers.
Higher speed than WAN: Faster than WANs but slower than LANs.
Common use: Connecting local government offices, universities,
and business districts.
NETWORKING DEVICES
Switch
Router
Hub
Format: A MAC address usually looks like six pairs of letters and
numbers separated by colons (e.g., 00:1A:2B:3C:4D:5E).
IP Address
2.Internet Layer
What it Does: This layer is responsible for routing data across different
networks. It uses the Internet Protocol (IP) to send packets of data
from the source device to the destination device, determining the best
path for that data. Example: When you visit a website, the Internet
layer helps direct your request to the correct server on the internet.
3.Transport Layer
What it Does: This layer ensures reliable data transfer between
devices. It uses protocols like Transmission Control Protocol (TCP) and
User Datagram Protocol (UDP) to manage data segmentation, flow
control, and error checking. Example: When you download a file, TCP
ensures that all pieces of the file arrive correctly and in order.
4.Application Layer
What it Does: This is the top layer where user applications operate. It
provides the interface for applications to communicate over the
network. Protocols like HTTP (for web browsing) and FTP (for file
transfer) function at this layer. Example: When you use a web browser
to access a website, you're interacting with the Application layer.
12
www.codelivly.com
Class A:
Range: 0.0.0.0 to 127.255.255.255
Used For: Large networks (e.g., internet service providers or large
corporations).
Number of Networks: Supports up to 128 networks.
Number of Hosts: Each network can support over 16 million hosts
(devices).
First Octet Range: 0 to 12
Class B:
Range: 128.0.0.0 to 191.255.255.255
Used For: Medium-sized networks (e.g., universities, large businesses).
Number of Networks: Supports up to 16,384 networks.
Number of Hosts: Each network can support up to 65,534 hosts.
First Octet Range: 128 to 191
Class C:
Range: 192.0.0.0 to 223.255.255.255
Used For: Small networks (e.g., home networks, small businesses).
Number of Networks: Supports up to 2 million networks.
Number of Hosts: Each network can support 254 hosts.
First Octet Range: 192 to 223
Class D (Multicast):
Range: 224.0.0.0 to 239.255.255.255
Used For: Multicast groups (sending data to multiple devices
simultaneously).
Not Used for Hosts: This class is reserved for special use.
Class E (Experimental):
Range: 240.0.0.0 to 255.255.255.255
Used For: Reserved for research and experimental purposes.
Not Used for Hosts: This class is not for public use.
13
www.codelivly.com
https://notes.davidvarghese.dev
https://www.cbtnuggets.com/
When two devices are on the same network (e.g., in the same office or home),
they use a device called a switch to communicate. The switch forwards the
data packet to the correct device based on the MAC address.
https://www.slideshare.net/
If the devices are on different networks (for example, one device is in your
home, and another is on the internet), then a router is used to handle the
communication.
How Devices Find Each Other Using ARP (Address Resolution Protocol)
Sometimes, a device may know the IP address of the device it wants to send
data to, but it doesn’t know the MAC address (which is needed for local
delivery). This is where ARP comes in.
ARP’s Job: ARP helps find the MAC address of the device by essentially
asking, “Who has this IP address?” When the correct device responds
with its MAC address, the sending device can now send the data directly
using the switch.
www.codelivly.com 16
Networking Protocols
Networking protocols are sets of rules and standards that allow devices
(computers, servers, routers, etc.) to communicate with each other across
networks like the internet or local networks. These protocols define how data
is transmitted, routed, and received between devices.
1. TCP (Transmission Control Protocol)
2. IP (Internet Protocol)
Purpose: Responsible for addressing and routing packets of data so that
they can travel across networks and reach the correct destination.
How It Works: Every device has an IP address, and IP protocols help
guide data from one IP address to another.
Example: IP is part of the foundational TCP/IP model used on the
internet.
Purpose: Used for sending emails from a client to a mail server and
between mail servers.
How It Works: SMTP handles the outbound emails, while protocols like
IMAP and POP3 are used for retrieving emails.
Example: Every time you send an email, it's transmitted via SMTP.
Example: If you send a message over the internet, it will be broken into
packets, which will be routed to the destination through different networks.
Frame
A frame is a unit of data used at the data link layer (Layer 2) of the OSI
model. It is the packet's next form when it's transmitted across the
local network (like through Ethernet or Wi-Fi). It contains the source
and destination MAC addresses.
Frames are used by switches and Network Interface Cards (NICs) to move
data within a local network. While packets carry data between different
networks, frames are responsible for getting data from one device to
another within the same network.
Structure: A frame contains:
Example: When a packet arrives at your local network, your router or switch
will encapsulate it into a frame for delivery to your specific device.
20
www.codelivly.com
5. Nslookup
Purpose: Nslookup is used to query DNS servers and find IP addresses
associated with domain names. Example: If you type "nslookup
google.com," it will return the IP address for Google's domain name,
showing which IP address your computer will use when contacting
Google.
21
www.codelivly.com
7. Nmap
Purpose: Nmap is a network scanning tool used to discover devices and
services on a network by scanning for open ports. Example: By running
"nmap 192.168.1.1", you can scan a device on your local network to see
which ports are open, revealing what services are running on that device
(like a web server or an FTP server).
8. Netcat (NC)
Purpose: Netcat reads and writes data across network connections using
TCP or UDP protocols, often used for testing. Example: Typing "nc
192.168.1.1 80" will try to open a connection to a device with the IP
address 192.168.1.1 on port 80, which is typically used by web servers.
This is helpful for checking if a port is open.
9. Dig
Purpose: Similar to nslookup, Dig queries DNS servers but provides more
detailed information. Example: By typing "dig google.com," you'll get a
detailed report of DNS queries, including the domain's IP address and
other DNS records like mail servers.
10. FTP
Purpose: FTP transfers files between two devices over a network. Example:
You can connect to an FTP server with a command like "ftp example.com,"
log in, and transfer files between your computer and the server.
22
www.codelivly.com