0% found this document useful (0 votes)
22 views4 pages

Day 4 - Refresh

Uploaded by

Shivdev Kumar
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)
22 views4 pages

Day 4 - Refresh

Uploaded by

Shivdev Kumar
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/ 4

CIDR Notation:

CIDR (Classless Inter-Domain Routing) notation is used to define IP addresses and their associated
routing prefixes. It is expressed as an IP address, followed by a slash (/) and a number that indicates
how many bits in the IP address are used for the network portion.

Key Concepts:

1. IP Address Structure:
 IPv4 addresses are 32 bits long, divided into 4 octets (each 8 bits).
 Example: 192.168.1.0 is a 32-bit address that looks like this in binary:
11000000.10101000.00000001.00000000.

2. CIDR Notation:
 In CIDR, the IP address is followed by a slash (/) and a number, which specifies the number
of bits used for the network portion.
 Example: 192.168.1.0/24 means the first 24 bits represent the network portion, and the
remaining 8 bits represent the host portion.

3. Subnet Mask:
 The number after the slash represents the subnet mask. It is used to divide an IP address
into two parts: the network portion and the host portion.
 A /24 means that the first 24 bits are "1"s (network portion), and the remaining bits (8 bits)
are "0"s (host portion), i.e., 255.255.255.0.

Calculating CIDR:

1. Determine Network Portion:


 The number after the / indicates how many bits are used for the network.
 Example: /24 uses the first 24 bits as the network portion, leaving 8 bits for host addresses.

2. Calculate Number of Hosts:


 To calculate the number of host addresses, take the number of bits remaining for the host
(total 32 bits in IPv4) and use the formula:
2Number of Host Bits−2
The -2 accounts for the network address and broadcast address.

 For a /24 network, you have 32 - 24 = 8 bits for hosts.


28−2=256−2=254 hosts

3. Convert Subnet Mask to Dotted Decimal:


 Convert the number of network bits into a subnet mask.
 Example: /24 corresponds to 255.255.255.0, which in binary is
11111111.11111111.11111111.00000000.

Example:

If you have 192.168.10.0/26, the /26 means the first 26 bits are for the network:
 Network Portion: 192.168.10.0 (26 bits)
 Subnet Mask: 255.255.255.192
 Number of Hosts: 2^{32-26} - 2 = 62
While Classful Addressing is largely obsolete today (replaced by CIDR or Classless Inter-Domain
Routing), understanding the classes helps explain the history of how IP address allocation worked.
Here's an overview of the IP address classes:

1. Class A:
 Range: 1.0.0.0 to 126.255.255.255 (the first octet is between 1 and 126).
 Default Subnet Mask: 255.0.0.0.
 CIDR Notation: /8.
 Network-Host Bits: First 8 bits are for the network portion, remaining 24 bits for the host
portion.
 Number of Networks: 128 networks.
 Hosts per Network: ~16.7 million (2^24 - 2).
 Use Case: Designed for large networks, like multinational companies or ISPs, where many
devices need unique IP addresses.
2. Class B:
 Range: 128.0.0.0 to 191.255.255.255.
 Default Subnet Mask: 255.255.0.0.
 CIDR Notation: /16.
 Network-Host Bits: First 16 bits for the network, remaining 16 bits for the host.
 Number of Networks: ~16,384 networks.
 Hosts per Network: ~65,534 hosts.
 Use Case: Suitable for medium-sized networks, like large organizations or universities.

3. Class C:
 Range: 192.0.0.0 to 223.255.255.255.
 Default Subnet Mask: 255.255.255.0.
 CIDR Notation: /24.
 Network-Host Bits: First 24 bits for the network, last 8 bits for the host.
 Number of Networks: ~2 million networks.
 Hosts per Network: 254 hosts.
 Use Case: Designed for small networks, such as small businesses or local offices.

4. Class D (Multicast):
 Range: 224.0.0.0 to 239.255.255.255.
 Use Case: Reserved for multicasting, where a message or packet is sent to multiple devices
at once. Used in specialized applications like streaming video or real-time data distribution.

5. Class E (Experimental):
 Range: 240.0.0.0 to 255.255.255.255.
 Use Case: Reserved for experimental purposes and future use. Not used for standard IP
addressing.

OSI Model's Seven Layers:

Layer 1: Physical Layer

 Deals with the physical connection between devices and the transmission of raw binary
data over the network medium.
 Cables (Ethernet, fiber optic), Hubs, Network Interface Cards (NIC)
 Establishes and maintains the physical connection; defines the hardware responsible for
transmitting raw bits over the medium.

Layer 2: Data Link Layer

 Manages node-to-node data transfer and error detection. It handles data packets called
frames and provides error-checking through MAC (Media Access Control) addresses.
 Switches, Bridges, MAC Addresses, Ethernet.
 Ensures data is transmitted error-free between nodes on the same network segment.

Layer 3: Network Layer

 Handles the logical addressing and routing of data across different networks. Data packets
here are called packets.
 Routers, IP Addresses, IPv4/IPv6, ARP (Address Resolution Protocol).
 Ensures data is routed correctly between devices on different networks.

Layer 4: Transport Layer


 Manages end-to-end data transmission and error recovery. It ensures complete data
transfer and data integrity using protocols like TCP (Transmission Control Protocol) and UDP
(User Datagram Protocol).
 TCP, UDP, Port Numbers (e.g., port 80 for HTTP).
 Ensures reliable data transmission, flow control, and segmentation.
 A developer troubleshooting slow or unreliable network communication in an application
would inspect how TCP/UDP connections are established and maintained.

Layer 5: Session Layer

 Establishes, manages, and terminates communication sessions between two devices or


applications.
 Manages sessions and dialogues between applications and ensures that connections
remain open for data to be transferred.
 Handling login sessions or managing remote access connections would involve Layer 5.

Layer 6: Presentation Layer

 Ensures that data is presented in a readable format, managing data encryption,


compression, and translation between different data formats.
 SSL/TLS (encryption), JPEG, MPEG, GIF, ASCII, EBCDIC.
 Handles encryption and translation of data formats, making sure that data is transformed
into a format the application can process.
 When dealing with secure web traffic (e.g., HTTPS), SSL/TLS encryption occurs at Layer 6.

Layer 7: Application Layer

 Closest to the user, this layer provides services that directly interface with the end-user or
application. It facilitates network services such as email, file transfer, and web browsing.
 HTTP, FTP, SMTP, DNS, SNMP, Telnet.
 Provides network services directly to the end-user's application.
 A web developer ensuring that HTTP requests and responses between browsers and
servers are functioning properly would work at Layer 7.

You might also like