Lecture 8
Lecture 8
Lecture 8
Slide: Subnets
What is a subnets?
A subnet is a logical subdivision of an IP network, and devices within the same subnet can
communicate with each other directly without the need for routing through an intervening router.
A subnet mask is a 32-bit number that divides an IP address into network and host portions. It's used
to delineate the network ID from the host ID within an IP address. The subnet mask contains a series
of contiguous "1" bits followed by contiguous "0" bits.
Class A: 255.0.0.0 or /8
For this IP, only the blue will change in the network.
Note: we can cannot use IP 192.168.1.0 and 192.168.1.255 for our network, they are reserved.
Usable IP addresses:
Subnetting allows for custom subnet masks to create smaller, more efficient subnets. Common
examples include:
255.255.255.128 or /25
255.255.255.192 or /26
255.255.255.224 or /27
255.255.255.240 or /28
Subnetting is the process of dividing an IP network into sub-networks to improve performance and
security. This segmentation is achieved by creating smaller, more manageable groups of devices
within the larger network.
Step 1: Determine the number of hosts per network and convert to binary
60 = 64 32 16 8 4 2 1
/24 = 255.255.255.0
255.255.255.255. 00000000
255.255.255 . 11000000 = we must input six zero as we had 6 bits in the steps above and the
remaining one become 1.
255.255.255.192 / 26
192.168.1.0 ----- 63 = as we must look at the last one in the above step which is 64.
192.168.1.64 --- 127 (63+64) = We must look for and use the range where there is the least wastage.
192.168.1.0 ----- 63 is the least wastage we can get IP address for our 60 hosts.
Step 1: 32 16 8 4 2 1
1 0100
20 hosts = 5 bits
Step 2:
/24 = 255.255.255.0
255.255.255.255. 00000000
255.255.255 .11100000
255.255.255.224 / 27
Step 3:
Answer: 192.168.1.64 / 27
20 host
Total IP = 32
Usable = 30
Wastage = 10
The answer if we did not use the first 64 address in the 60 hosts
------------------------------------------------------------------------
192.168.1.0 --- 31
192.168.1.32 ----63
Answer: 192.168.1.0 / 27
20 host
Total IP = 32
Usable = 30
Wastage = 10
---------------------------------------------------------------------------
Classless Inter-Domain Routing (CIDR) is an IP address allocation method that improves data routing
efficiency on the internet.
The Dynamic Host Configuration Protocol (DHCP) is a network protocol used to automatically assign
and manage IP addresses and other network configuration information to devices on a network.
DHCP simplifies the process of IP address management and helps prevent conflicts caused by manual
IP address assignment. The WIFI router works like this at home. It will give all people at home an IP
address from its pool of addresses.
How DHCP assign the IP:
Hierarchical addressing and route aggregation are concepts used in networking to efficiently
organize and manage IP addresses and routing information.
These concepts play a crucial role in reducing the size of routing tables and improving the scalability
and performance of the Internet.
Slide: IP Addressing: Last Words
These institution are given IP addresses and they sell them to local ISP and we buy it from them.
Slide: NAT: Network Address Translation
Network Address Translation (NAT) is a technique used in networking to map private IP addresses
within a local network to a single public IP address, or a small range of public IP addresses, when
accessing resources on the Internet.
NAT allows multiple devices in a private network to share a common public IP address, providing a
layer of security and conserving public IP address space (Conserving IPv4).
Advantages of NAT:
NAT allows multiple devices in a local network to share a single public IP address, which conserves
the limited pool of available public IP addresses.
Security:
NAT acts as a basic firewall by hiding the internal network structure. It prevents direct access to
devices with private IP addresses from the Internet.
Address Space Flexibility:
Private IP addresses can be used within a local network without conflicting with public IP addresses
on the Internet.
A router should only process up to layer 3. (Changing ports number is transport layer jobs.)
NAT will not be used as much as IPv6 is going to resolve the IPv4 shortage.
Transition from IPv4 to IPv6 = New equipment is needed. Costly (need new switches)
Version (4 bits):
Indicates the version of the IP protocol. For IPv6, this field is set to 6.
Similar to the IPv4 Type of Service (ToS) field. It is used to differentiate and prioritize traffic. It
includes the Differentiated Services Code Point (DSCP) and Explicit Congestion Notification (ECN)
fields.
Used to identify a flow, which is a sequence of packets sent from a source to a destination. The flow
label helps routers and switches to provide special handling for packets belonging to the same flow.
Specifies the length of the payload in octets (8-bit units), excluding the length of the IPv6 header.
The maximum payload length is 65,535 octets.
Identifies the protocol used in the payload, similar to the IPv4 Protocol field. For example, it might
indicate TCP, UDP, ICMPv6, or another protocol.
Similar to the IPv4 Time-to-Live (TTL) field. It limits the number of hops a packet can take in the
network, helping to prevent packets from looping indefinitely.
Source Address (128 bits):
Transition is not quickly. It takes time for company to invest and some won’t invest for the time
being.
How to use tunnelling to allow IPv4 network to communicate with an IPv6 network?
IPv6 tunneling is a technique used to enable the transmission of IPv6 packets over an IPv4 network
infrastructure. This is necessary when either the source or destination network does not natively
support IPv6. IPv6 tunneling encapsulates IPv6 packets within IPv4 packets, allowing them to
traverse IPv4 networks.
Encapsulation is the process of adding a header (and possibly a trailer) to the data (payload) of a
higher-layer protocol. The encapsulated data is then transmitted as the payload of a lower-layer
protocol.
Router B and E is hybrid. (understand both IPv4 and IPv6)
For the router A to send data to router F, it needs to send the IPv6 packet to Router B. Then, it will
encapsulate the IPv6 packet in a IPv4 packet which can be sent to Router E. Router E will then
decapsulate it for router F.
This process is like tunnel where the IPv6 is hidden in a IPv4 packet.
Slide: IP fragmentation/reassembly
IP fragmentation and reassembly are mechanisms used in the Internet Protocol (IP) to handle the
transmission of large packets across networks with smaller Maximum Transmission Unit (MTU) sizes.
When a packet is too large to be transmitted over a network with a lower MTU, IP fragmentation
breaks it into smaller fragments before transmission. The destination host then reassembles these
fragments to reconstruct the original packet.
Take resources and time to do this. This is why there is not this feature in IPv6.