0% found this document useful (0 votes)
29 views50 pages

Lesson 06

Uploaded by

Nushail Ziyadh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views50 pages

Lesson 06

Uploaded by

Nushail Ziyadh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Packet,IP Address

What is Packet
● A network packet is a small part of a larger message.
● When data is sent over networks, like the Internet, it’s split into packets.
● Each packet travels separately to the destination.
● The receiving device (computer, phone, etc.) recombines the packets to form the original
message.
ex: How packets work on the Internet.
Suppose a user needs to load an image. The image file does not go from a web server to the user's
computer in one piece. Instead, it is broken down into packets of data, sent over the wires, cables,
and radio waves of the Internet, and then reassembled by the user's computer into the original
photo.
Why we use packets in networking?
● Efficiency: Smaller packets are easier and faster to transmit than large data chunks.

● Error Handling: If there’s an error in one packet, only that part needs to be re-sent, not
the entire message

● Reliability: Packets can take different routes to avoid busy areas, ensuring faster
delivery.

● Network Sharing: Packets allow multiple users to share the network at the same time
without needing a dedicated line for each.

● Data Control: Using packets helps


manage and organize large amounts
of data sent over networks.
Parts of a Network Packet
❖ Header: Contains important info (source, destination, packet number).
❖ Payload: The actual data or content.
❖ Trailer: Contains info to check if data was received correctly.

Think of a packet as a letter: the header is the address, the payload is the message, and the
trailer ensures it’s delivered intact.

What is an IP packet?
● IP (Internet Protocol) is a network layer protocol that has to do with routing. It is used to make sure
packets arrive at the correct destination.

● Packets are sometimes defined by the protocol they are using. A packet with an IP header can be
referred to as an "IP packet."
(An IP header contains important information about where a packet is from (its source IP address),
where it is going (destination IP address), how large the packet is, and how long network routers should
continue to forward the packet before dropping it. It may also indicate whether or not the packet can be
fragmented, and include information about reassembling fragmented packets.)
How Packets Travel Across a Network

● Packets are sent from the source and travel through routers and switches.
● They may take different paths but reassemble at the destination.
Switching

Switching is the method of sending packets independently.

Common Issues with Packets

● Loss: Some packets may get lost.

● Delay: Packets might arrive out of order.

● Corruption: Data can get corrupted, needing retransmission.


IP Addressing
IP Addressing
● IP Addressing is Logical Addressing.It is a 32 bit sequences of 1s and 0s.
● It acts as a unique identifier, allowing devices to locate and communicate with each other.
● It works on Network Layer (Layer 3).
● Two devices on the internet can never have the same address at the same time.
● Every device—like computers, smartphones, routers, and printers—connected to the
internet or any local network requires an IP address to function.
● Think of an IP address like a home address, which guides information (like a letter or
package) to the correct destination.
● The address space of IPv4 is 232 or 4,294,97,297 (more than 4 billion).

2
Types of IP Addresses

● IPv4: Uses 32-bit addresses, ex: 192.168.1.1.


The most common type.Supports about 4.3 billion unique addresses.
● IPv6:Uses 128-bit addresses, ex: 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
Provides a much larger address space due to the increase in internet devices.

3
Structure of an IPv4 Address
● An IPv4 address uses a 32-bit format, broken down into four sets of 8 bits (octets), each separated by a
period. For example, 192.168.0.1 is an IPv4 address where:
● 192, 168, 0, and 1 are each octets.
● Each octet is a number between 0 and 255 because it uses 8 bits, and with 8 bits, you can represent numbers
from 0 to 255.

● The IPv4 address is divided into two main parts:


Network Portion: Identifies the specific network to which the device is connected.
Host Portion: Identifies the individual device (or "host") within that network.

Ex:-192.168.1.10
192.168.1 could be the Network Portion, indicating which local network the device is on. 3
10 could be the Host Portion, identifying the exact device within that local network.
Public vs Private IP Addresses

Public IP:
● A unique address that is accessible worldwide.( meaning no two devices on the internet can have the same
Public IP address at the same time.)

● This allows devices to find and communicate with each other across the globe. Public IPs are provided by
ISPs and act as the gateway to the internet.
Example: Websites, online servers, and any device that directly accesses the internet have Public IP addresses.
Public IPs like a street address
Private IP:
● Used for local communication within a specific network. They are not routed over the public internet, which
means they cannot be accessed directly from outside the local network. Devices in the same network use
Private IP addresses to communicate without using the internet.

Private IPs are like room numbers within a building.


3
Static vs Dynamic IP Addresses

Static IP Dynamic IP
A fixed, unchanging address that is manually Assigned automatically by DHCP (Dynamic Host
assigned to a device. Configuration Protocol).
Remains constant over time; it does not change. Changes periodically; each time a device
connects to the network, it might receive a
different IP address.
Ideal for servers, network printers, or devices Easier to manage for ISPs, as it allows efficient
that need a permanent, reliable address. use of a limited pool of IP addresses.
Easier to locate consistently, making it suitable Suitable for general internet use, as most users
for web servers, email servers, and other don’t need a constant IP.
resources that need a consistent connection.

3
How Does an IP Address Work?

● An IP address is used to route data between devices.


● Data is broken into packets, each containing source and destination IPs.
● Routers read IP addresses to forward packets to the correct destination.

Structure of IP
● IP Addresses consists of four sections.
● Each section is a 8 bit long.
● Each section can range 0-255.
● Written for example 199.122.254.25

3
Notations of IP Address
The two prevalent notations for representing an IPv4 address are binary notation and dotted decimal
notation.
Binary Notation
● In binary notation, an IPv4 address 32 bits are divided into four groups of 8 bits, known as octets.
Each octet is a section of the address that represents a value between 0 and 255.
● Example: 01110101 10010101 00011101 00000010
● Each group of 8 bits is an octet.
● 01110101 represents the first octet, 10010101 the second, and so on.
Dotted Decimal Notation
● In dotted decimal notation, each octet is converted from binary to a decimal number and
separated by dots.
● Each octet ranges from 0 to 255 (since 8 bits can represent any number from 0 to 255).
● The binary example 01110101 10010101 00011101 00000010 is translated to its decimal form:

01110101 → 117 10010101 → 149 00011101 → 29 00000010 → 2


Resulting in the dotted decimal address: 117.149.29.2. 3
Valid IP Address Invalid IP Address

10.10.5.80 111.56.045.78- There must be no leading zero (045)


240.230.220.89 221.34.7.8.20 - 4 Octels only in IPv4
1.2.3.4 75.45.301.14- Range of each octel is between 0 to 255
99.88.7.89 1100010.2.14.7- A mixture of binary and dotted
100.200.89.90 decimal notations is not allowed.

3
Conversion Binary to Decimal & Decimal to Binary
Convert the IPv4 address from Binary to Dotted decimal
notation 10000001 00001011 01001011 11101111
129.11.75.239

27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
1 0 0 0 0 0 0 1 129
0 0 0 0 1 0 1 1 11
0 1 0 0 1 0 1 1 75
1 1 1 0 1 1 1 1 239

3
Convert the IPv4 address from dotted decimal to binary
notation 145.14.6.8
10010001 00001110 00000110 00001000

145 14 6 8
10010001 00001110 00000110 00001000

27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
1 0 0 1 0 0 0 1 145
0 0 0 0 1 1 1 0 14
0 0 0 0 0 1 1 0 6
0 0 0 0 1 0 0 0 8
3
Questions

3
01.) 208.34.54.12-
11010000.100010.110110.1100

208 34 54 12
11010000 100010 110110 1100

02.) 11101111 11110111 11000111 00011101- 239.247.199.29

27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
1 1 1 0 1 1 1 1 239
1 1 1 1 0 1 1 1 247
1 1 0 0 0 1 1 1 199
0 0 0 1 1 1 0 1 29
Q: Convert the IPv4 address 192.168.15.10 from dotted decimal to binary notation.

Q: Convert the IPv4 address 11000000 10101000 00000001 00001101 from binary to dotted decimal
notation.
IP Address Classes
Total IP Addressing Scheme is divided into 5 Classes
CLASS A - Reserver for Government.
CLASS B - Reserved for Companies.
CLASS C - Reserved for Companies.
CLASS D- Reserved for Multicasting.
CLASS E - Reserved for future use.

3
Classes of IPv4 Address

3
Octel Format in IP Address

IP Address divided into Network


portion & Host Portion.

● Class A Written as
N.H.H.H
● Class B Written as
N.N.H.H
● Class C written as
N.N.N.H

3
IP range

3
Find the classes of following IP addresses

IP Address Class
192.168.1.10
10.10.200.6
172.15.165.1
230.10.65.30
180.14.18.1
254.254.25.3
8.10.254.250

3
Network & Broadcast Address
● The network address is represented with all bits as
ZERO in the host portion of the address
● The broadcast address is represented with all bits as
ONES in the host portion of the address
● Valid IP Addresses lie between the Network Address
and the Broadcast Address.
● Only Valid IP Addresses are assigned to hosts/clients.

3
3
Class A
● Class A IP addresses range from 0.0.0.0 to 127.255.255.255.
● The first octet (or group of 8 bits) always starts with a 0, so Class A addresses are in the range 1 to 126 in the
first octet.
Network Portion: The first 8 bits (or first octet) indicate the network part of the address.
Host Portion: The remaining 24 bits are used for the host part, allowing many hosts on each network.
● IP addresses belonging to class A are assigned to the networks that contain a large number of hosts.
● Class A is suitable for very large networks, with up to 16 million hosts per network.
Example of Class A IP: 10.0.0.1

3
Number of Networks
● Class A uses 7 bits in the first octet for the network (since the first bit is always 0).
● Possible combinations for 7 bits = 27=128 networks.
● However, addresses 0.0.0.0 and 127.0.0.0 are reserved, leaving 126 usable networks.

Number of Hosts per Network


● The remaining 24 bits in Class A are used for hosts.
● Possible combinations for 24 bits = 224= 16,777,216224=16,777,216 addresses.
● We subtract 2 addresses (network and broadcast addresses), so 16,777,214 usable hosts
per network.

3
Another method to calculate host & network address

3
Class B
● Class B IP addresses range from 128.0.0.0 to 191.255.255.255.
● The first octet starts with 10, so Class B addresses are in the range 128 to 191 in the first octet.
● Network Portion: The first 16 bits (or first two octets) indicate the network part of the address.
● Host Portion: The remaining 16 bits are used for the host part, allowing many hosts on each network.
● IP addresses belonging to Class B are assigned to medium-sized networks, such as universities or large
companies.
● Class B is suitable for networks with up to 65,534 hosts per network.
Example of Class B IP: 172.16.0.1

3
Number of Networks
● Class B uses 14 bits in the first two octets for the network portion (since the first two
bits are always 10).
● For 14 bits, the possible combinations are 214= 16,384214=16,384 networks.
Number of Hosts per Network
● The remaining 16 bits are used for hosts.
● For 16 bits, the possible combinations are 216 = 65,536 addresses.
● We subtract 2 addresses (network and broadcast addresses), leaving 65,534 usable
hosts per network.

3
Another method

3
Class C
● Class C IP addresses range from 192.0.0.0 to 223.255.255.255.
● The first octet starts with 110, so Class C addresses are in the range 192 to 223 in the first octet.
● Network Portion: The first 24 bits (or first three octets) indicate the network part of the address.
● Host Portion: The remaining 8 bits are used for the host part, allowing a limited number of hosts per
network.
● IP addresses belonging to Class C are assigned to small networks, such as small businesses or home
networks.
● Class C is suitable for networks with up to 254 hosts per network.
Example of Class C IP: 192.168.1.1

3
Number of Networks
● Class C uses 21 bits in the first three octets for the network portion (since the first
three bits are always 110).
● For 21 bits, the possible combinations are 221=2,097,152 networks.
Number of Hosts per Network
● The remaining 8 bits are used for hosts.
● For 8 bits, the possible combinations are 28=256 addresses.
● We subtract 2 addresses (network and broadcast addresses), leaving 254 usable hosts
per network.

3
Another Method

3
Subnetting
● A subnet mask differentiates the network portion and host portion of an IP address.
● Splits a large network into smaller, manageable segments.
● Purpose: It helps identify the network ID and the host ID within that network, making it easier to organize
and manage IP addresses.
● Helps improve network efficiency and security.
Subnet masks work by using binary notation:
1s represent the network portion.
0s represent the host portion.
For example:
A Class C default subnet mask, 255.255.255.0, in binary is 11111111.11111111.11111111.00000000. The
first 24 bits are for the network, and the last 8 bits are for the hosts.

3
3
3
3
3
Question:
An organization follows Class B for their internal network. One of the hosts in the network
has an IP address 172.16.35.10. Find the number of addresses, the network address, and the
broadcast address of the organization’s network.

Question:
An organization uses a Class C network for their internal systems. One of the hosts in the
network has the IP address 192.168.5.12. Determine the number of addresses, the network
address, and the broadcast address of the organization’s network.

3
Solution for Question 01:
Class B Network
1. IP Address Format:
○ Class B IPs use the format N.N.H.H with a subnet mask of 255.255.0.0 (/16).
○ Example IP: 172.16.35.10
2. Network Range:
○ This network range is from 172.16.0.0 to 172.16.255.255.
3. Number of Addresses:
○ Total possible addresses for Class B: 216=65,536.
4. Number of Usable Addresses:
○ Usable addresses = 65,536−2=65,534.
5. Network Address (First Address):
○ 172.16.0.0
6. Broadcast Address (Last Address):
○ 172.16.255.255

3
Solution for Answer 2:
Class B Network
1. IP Address Format:
● Class C IPs use the format N.N.N.H with a subnet mask of 255.255.255.0 (/24).
● Example IP: 192.168.5.12

2. Network Range:
● This network range is from 192.168.5.0 to 192.168.5.255.
3. Number of Addresses:
● Total possible addresses for Class C: 28=256.
4. Number of Usable Addresses:
● Usable addresses = 256−2=254.
5. Network Address (First Address):
● 192.168.5.0
6. Broadcast Address (Last Address):
Basics of Cisco Packet Tracer (Part 2) |
● 192.168.5.255 Hub

3
An organization uses the IP address 192.168.1.10 with a subnet mask of 255.255.255.0 for one of its
networks.

Calculate the Network Address for this IP configuration.


Determine the Broadcast Address for this IP configuration.
Data Communication & Networking

The End
Good luck for your final exam!!

Full Name 2022 March 27


Week IV

You might also like