L24. What is longest prefix matching and how is it used? Flashcards

1
Q

What is longest prefix matching?

A

Longest prefix matching is an algorithm used in networking for routing IP packets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does longest prefix matching work?

A

It determines the best route for forwarding a packet by finding the most specific (longest) prefix in the routing table that matches the destination IP address of the packet (included in the IP packet header).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does routers determine where to forward a packet?

A

Routers maintain a routing table containing entries that specify which next-hop router or network interface should be used to forward packets destined for particular IP address ranges.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does an entry in a routing table consist of?

A

Each entry in the routing table consists of a network prefix and its associated subnet mask, which together define the range of IP addresses that the entry covers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does the router perform longest prefix matching?

A

The router compares the IP packet’s destination address against all the prefixes in its routing table. The goal is to find the entry with the longest matching prefix, which is the most specific route available for the given destination address.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What steps are involved in longest prefix matching?

A
  1. The router receives a packet
  2. The router extracts the destination IP address from the packet header
  3. The router compares the destination IP address against the prefixes in its routing table, checking how many leading bits (from the left) of the destination IP address match the prefix
  4. The router identifies the prefix that has the most leading bits in common with the destination IP address. This prefix is the longest matching prefix, indicating the most specific route.
  5. The router forwards the packet to the next-hop router or network interface specified in the routing table entry corresponding to the longest matching prefix.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

For a destination address 192.168.1.140, next-hop destination will be selected from the following table using longest prefix matching?

A. 192.168.0.0/16
B. 192.168.1.0/24
C. 192.168.1.128/25

A

C. The /25 prefix (192.168.1.128) matches the first 25 bits (192.168.1.1…), which is the longest match.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does longest prefix matching aid router efficiency?

A

By selecting the most specific route, the router ensures that packets are sent along the optimal path, reducing congestion and improving network performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How is longest prefix matching beneficial for large networks?

A

In large-scale networks, longest prefix matching helps manage the complexity of routing tables. It allows for hierarchical IP address allocation, where large networks are subdivided into smaller subnets, each with its own prefix. This hierarchical structure simplifies routing decisions and conserves routing table space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can longest prefix matching be leveraged for security?

A

Network administrators can use longest prefix matching to implement routing policies and security measures. By configuring specific prefixes with particular next-hops, they can control traffic flow and apply policies such as load balancing, traffic shaping, or access control.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly