M4 Questions and Answers
M4 Questions and Answers
MODULE 4
● Time to live: This 8-bit long field is used to limit the packet life time in
Internet. It holds a timestamp, which is decremented by each visited router.
● Protocol: This 8-bit field defines the higher-level protocol that uses the
services of the IP layer.
● Checksum: The error detection method used by most TCP/IP protocols is
called the checksum. The checksum protects against the corruption that may
occur during the transmission of a packet.
● Source address: This 32-bit field defines the IP address of the source.
● Destination address: This 32-bit field defines the IP address of the
destination.
● Options: Options are not required for every datagram they are for testing and
debugging.
IP Addresses
● The identifier that is used in the Network Layer (OSI Model) or Internet Layer (TCP/IP
Model) is called internet protocol address or IP address.
● It is a 32-bit binary address, implemented uniquely and universally defines a host or
router on the internet.
● Every host and router on internet has an unique universally identified IP address.
● This 32 bit long address are used in source address and destination address field of
IP packets.
● Classes and Classfull Addressing:
○ The IP addresses are divided into five categories or five classes.
○ The allocation of IP address in the different classes is called Classfull
Addressing.
○ 5 classes of IP addresses are:
1. Class A: In a Class A type of network, the first 8 bits (also called the
first octet) identify the network.
● The leftmost bit must be zero to define class A , the remaining 7 bit
define different networks.
● The number of networks that have class A IP adress is very limited -
2^7 = 128 networks, among which two of the addresses are reserved
for special purposes.
● In class A, 24 bits are used to define host id
● 2^24 = 16,777,216 hosts can be connected to class A network, two of
them are reserved for special purposes.
● Address range : 0.0.0.0 to 127.255.255
2. Class B: In a Class B type of network, the first 16 bits (the two octet)
define the network id.
● Two leftmost bit are '10' to define class B, next 14 bit define different
networks.
● There are 2^14 = 16,384 class B networks.
● In class B 16 bits are used to define hosts.
● 2^16 = 65,536 hosts.
● Address range: 128.0.0.0 to 191.255.255.255
3. Class C: In Class C 3 octets define net id and one octet define host id
● The 3 leftmost bit is set to 110 to define class C and remaining 21 bit
to define networks.
● 2^21 = 2,097,152 networks
Subnet masking
● Subnet Masking identifies the boundary between the host ID and the combination of
net ID and subnet ID.
● Each subnet mask comprises 32 bits that correspond to the bits in an IP address.
● It gives the network address in the address block when AND operation is bitwise
applied on the mask and any IP address of the block.
● In a subnet mask, the consecutive ones represent the net ID and subnet ID, and
consecutive zeros represent the host ID.
● The default mask in different classes are :
○ Class A
■ Dotted decimal: 255.0.0.0
■ Binary : 11111111 00000000 00000000 00000000
○ Class B
■ Dotted decimal: 255.255.0.0
■ Binary: 11111111 11111111 00000000 00000000
○ Class C
■ Dotted decimal: 255.255.255.0
■ Binary: 11111111 11111111 11111111 00000000
● Every device or domain that connects to the Internet is assigned an IP address, and
as packets are directed to the IP address attached to them, data arrives where it is
needed.
● Following are the internet control protocols:
○ Address resolution protocol (ARP): ARP is used to find the physical
address of node when it's internet address is known.
○ Reverse address resolution protocol (RARP): RARP is used when internet
address of host is unknown and physical address is known.
○ Internet control message protocol (ICMP): ICMP is a mechanism used by
hosts and routers to sending error messages and operations information.
○ Internet group message protocol (IGMP): IGMP is used by hosts and
routers that supports multicasting. It lets all the systems on a physical network
know which host currently belong to which multicast group.
○ Boot starp protocol (BOOTP): BOOTP enables a configuration server to
automatically assign an IP address to network systems in IP networks.
4. Explain internet control message protocol (ICMP) and internet group
message protocol (IGMP).
A:
Internet control message protocol (ICMP)
● IP does not have an inbuilt mechanism for sending error and control messages.
● It depends on Internet Control Message Protocol(ICMP) to provide an error control.
● It is used for reporting errors and management queries.
● ICMP is a mechanism used by hosts and routers to sending error messages and
operations information.
● Always report the error message to the orginal source.
● ICMP messages
○ ICMP messages are usually divided into two categories:
● IGMP messages
a. Membership Query: The query messages are sent by the query router of the
network to enquire about the active members of a group. The query
messages are further classified as:
■ General Query Message: With this query message the router enquires
host about all the groups the host is involved in.
■ Group-Specific Query Message: With this query message the router
enquires the host or router if there are interested in a specific multicast
group.
■ Group-Source Specific Query Message: With this query message the
query router enquires the hosts or router if it is still interested in the
specific multicast group coming from a specific source.
b. Membership Report: The receiving members of the multicast group send the
membership report either in response to the membership query message or if
they are registering the group for the first time.
c. Leave Group: The receiving members of the multicast group sent this
message to the multicast router if they are not interested in a specific
multicast group anymore.
● Application of multicasting:
a. Access to Distributed Databases:Most of the large databases today are
distributed. That is, the information is stored in more than on location, usually
at the time of production.
The user who needs to access the database does not know the location of
the information.
A user's request is multicast to all the database locations, and the location
that has the information responds.
b. Information Dissemination:Businesses often need to send information to
their customers. If the nature of the information is the same for each
customer, it can be multicast.
In this way a business can send one message that can reach many
customers. For example, a software update can be sent to all purchasers of a
particular software package.
c. Dissemination of News:In a similar manner news can be easily
disseminated through multicasting. One single message can be sent to those
interested in a particular topic.
d. Teleconferencing: Teleconferencing involves multicasting. The individuals
attending a teleconference, all need to receive the same information at the
same time. Temporary or permanent groups can be formed for this purpose.
e. Distance Learning: One growing area in the use of multicasting is distance
learning. Lessons taught by one single professor can be received by a
specific group of students.
● Working of BOOTP
○ When a BOOTP client is started, it has no IP address.
○ so it broadcasts a message containing its MAC address onto the network.
○ This message is called a “BOOTP request,”.
○ It is picked up by the BOOTP server, which replies to the client with the
following information that the client needs:
■ The client’s IP address, subnet mask, and default gateway address
This can be any device like computer, laptop, IoT endpoint or anything else
that requires connectivity to the network.
Most of the devices are configured to receive DHCP information by default.
○ IP address pool:IP address pool is the range of addresses that are available
to DHCP clients.
IP addresses are typically handed out sequentially from lowest to the highest.
○ Subnet:Subnet is the partitioned segments of the IP networks.
Subnet is used to keep networks manageable.
○ Lease:Lease is the length of time for which a DHCP client holds the IP
address information.
When a lease expires, the client has to renew it.
● Advantages:
○ Centralised management of IP addresses
○ Ease of adding new clients to a network
○ Reuse of IP addresses reducing the total number of IP addresses that are
required
○ Simple reconfiguration of the IP address space on the DHCP server without
needing to reconfigure each client
● Disadvantage:
○ IP conflict can occur
● OSPF Working:
○ Step 1: The first step is to become OSPF neighbors. The two connecting
routers running OSPF on the same link creates a neighbour relationship.
○ Step 2: The second step is to exchange database information. After becoming
the neighbors, the two routers exchange the LSDB information with each
other.
○ Step 3: The third step is to choose the best route. Once the LSDB
information has been exchanged with each other, the router chooses the best
route to be added to a routing table based on the calculation of SPF.
● Types of links in OSPF:
○ In OSPF, the connection between two routers is known as link.
○ There are 4 types of link in OSPF.
● When a host tries to interact with another host, an ARP request is initiated.
If the IP address is for the local network, the source host checks its ARP
cache to find out the hardware address of the destination computer.
● If the correspondence hardware address is not found, ARP broadcasts the
request to all the local hosts.
● All hosts receive the broadcast and check their own IP address. If no match
is discovered, the request is ignored.
● The destination host that finds the matching IP address sends an ARP reply
to the source host along with its hardware address, thus establishing the
communication.
● The ARP cache is then updated with the hardware address of the
destination host.
● IPv6 features:
○ Supports source and destination addresses that are 128 bits (16 bytes) long.
○ Requires IPSec support.
○ Uses Flow Label field to identify packet flow for QoS handling by router.
○ Allows the host to send fragments packets but not routers.
○ Doesn't include a checksum in the header.
○ Uses a link-local scope all-nodes multicast address.
● IPv6 packet format
a. Diagnostic Messages: ICMPv6 Echo request and Echo reply are the
Diagnostic messages.
Every IPv6 host must return an ICMPv6 Echo reply when it receives an
ICMPv6 Echo request.
b. MLD (Multicast Listener Discovery) Messages: ICMPv6 MLD Messages
are used by an IPv6 enabled router to discover hosts who are interested in
multicast packers, and the multicast addresses they are interested. MLD
messages are used by MLD Protocol. MLD (Multicast Listener Discovery)
Protocol is the IPv6 equivalent of IGMP (Internet Group Management)
Protocol in IPv4.
c. ND (Neighbour Discovery) Messages: ICMPv6 ND Messages are used for
the Neighbour Discovery Protocol (NDP). ND Messages includes Router
Solicitation & Router Advertisement, Neighbour Solicitation and Neighbour
Advertisement.
● BGP is especially used for exchanging routing information between all of the major
Internet Service Providers (ISPs). as well between larger client sites and their
respective ISPs. And, in some large enterprise networks, BGP is used to
interconnect different geographical or administrative regions.
● Some of the primary attributes of BGP is the use of pieces of information about a
known route, where it came from. and how to reach it, A BGP router will also
generate an error message if it receives a route that is missing.
● Characteristics of BGP:
○ It is an advanced distance vector protocol.
○ It sends full routing updates at the start of the session, trigger updates are
sent afterward.
○ BGP maintains connection by sending periodic keepalives
○ It creates and maintains connection by using TCP port 179.
○ It has its own routing table, although it is capable of both sharing and inquiring
of the interior IP routing table.
● BGP Message Format:
For example, there are two routers, i.e., R1 and R2. The R1 sends the keep
alive packet to R2 while R2 sends the keep alive packet to R1 so that R1 can
get to know that R2 is alive, and R2 can get to know that R1 is alive.
d. Notification: The notification packet is sent when the router detects the error
condition or close the connection.
10. Given IP Address – 172.16.0.0/25, find the number of subnets and the
number of hosts per subnet. Also, for the first subnet block, find the
subnet address, first host ID, last host ID and broadcast address.
Solution:
● This is a class B address.
● Number of subnets : 2^(Given bits for mask – No. of bits in default mask)
○ No of bits in mask = 25
○ No of bits in default mask = 16
○ Number of subnets = 2^(25-16) = 2^9 = 512.
● Number of hosts per subnet : 2^(32 – Given bits for mask) – 2
= 2^(32-25) – 2 = 2^7 – 2 = 128 – 2 = 126
● Subnet address : AND result of subnet mask and the given IP address
○ For the first subnet block, we have subnet address = 0.0
● First Host ID : Subnet address + 1
○ first host id = 0.1,
● Last Host ID : Subnet address + Number of Hosts
○ No of hosts = 126
○ last host id = 0.126
● Broadcast address : By putting the host bits as 1 and retaining the network bits as in
the IP address
○ broadcast address = 0.127