Network Layer Flashcards

1
Q

List all the headers of an IP packet.

A

An IP packet is 32 bits wide and 20 bytes long at max. It has the following fields:

  1. Source and destination address fields.
  2. Type of Service field: allows us to tell a router how the datagram should be treated in terms of speed and reliability.
  3. Version field: for IPv4, it is 4: 0100
  4. Header Length field: represents the total IPv4 Header Length
  5. Total Length field: a packet may be smaller than the minimum LAN packet size or larger than the maximum.
  6. Time-to-live (TTL) field: is decremented by 1 at each router. If it reaches 0, the packet is discarded. The TTL field is there to prevent routing loops.
  7. Protocol field: contains a value to identify the contents of the packet body — e.g., ICMP packet, IP-in-IP packet, TCP packet, etc.
  8. Header checksum field: is applied to the header only, not the body. Its purpose is to allow the discarding of packets with corrupted headers.
  9. RF flag: Reserved for later use
    10: DF flag: Don’t Fragment. If a destination is incapable of reassembling fragments, this bit is set to inform routers not to fragment
  10. MF: More Fragments. All fragments except the last have this set.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the Type of Service Field in the IP Header.

A

The Type of Service field allows us to tell a router how the datagram should be treated in terms of speed and reliability. There are 4 bits, indicating a packet to be treated in a particular way:

  1. Minimize delay
  2. Maximize throughput
  3. Maximize reliability
  4. Minimize cost

The Differentiated Services suite uses the DS flag to specify preferential handling for designated packets, e.g., packets involved in VoIP or other real-time protocols.

The ECN flag allows routers experiencing congestion to mark packets, thus indicating that the transmission rate should be reduced.

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

Describe ARP and its purpose.

A

Address Resolution Protocol (ARP) is a link-layer protocol that broadcasts a special frame (called an ARP request) on the local medium. ARP is only supposed to run on the local network because a different network might be of a different physical type.

ARP exists to solve the gap between the physical layer addresses and network layer addresses. ARP is not restricted to Ethernet and IP, but can be used to pair any physical and network layer addresses.

The ARP replies are kept in an ARP cache that times out and clears every 20 minutes.

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

What is the destination hardware address on an ARP Request broadcast?

A

ARP broadcasts an ARP Request in an Ethernet frame with destination hardware address ff:ff:ff:ff:ff:ff and source its own Ethernet address.

All hosts on the local network read the frame. The target host recognises the request for its IP address and sends an ARP Reply.

This ARP Reply, in an Ethernet frame, contains its own Ethernet address. It knows the source’s Ethernet address as read from the ARP request packet.

The source now gets the reply and reads out the target’s Ethernet address. It can now use that Ethernet address to send IP packets. Other hosts on the network don’t need to do anything.

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

What happens in ARP if the destination is not on the local network?

A

The solution is to send the packet to a gateway host and let it figure out where to send it next.

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

What happens in ARP if a machine is down after sending an ARP request?

A

After a few seconds and a few ARP requests, the OS returns an error message to the application trying to make the IP connection.

This error might be “no such host” or “host unreachable.”

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

Why is ARP insecure?

A

ARP is open to spoofing. Host A could send a gratuitous ARP reply containing its hardware address for host B.

The other machines on the local network would then send data destined for B towards A, thus allowing A to read B’s data and deny B any data.

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

Describe RARP and when it is usually seen to be used.

A

Reverse ARP solves the opposite problem of ARP: given a hardware address, it finds the IP address.

RARP is used when a diskless machine boots and wants to find its IP address on the home network. A device, such as a refrigerator, may make a RARP request when it boots to find its IP address.

RARP is simple but is limited by the fact that a hardware broadcast only goes to the local network and is not passed between networks.

The general solution to finding an IP address in multiple networks is using DHCP.

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

Describe ARP Bridging and explain how it is different from a Gateway.

A

ARP Bridging allows us to extend an Ethernet (or another network) over a physically larger distance than its specifications allow.

It allows joining a wireless network to a wired one, so they appear to be a single network. A bridge is a host that joins two physical networks into one.

ARP Bridging works well for joining a pair of networks, but is less suitable for larger collections of networks, particularly when there are multiple routes between hosts.

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

Describe Remote Bridging.

A

ARP Bridging is used to connect widely separated networks, e.g., over a WAN, so they appear as a single network. This is known as Remote Bridging.

Remote bridging is similar in principle to local bridging, but now such bridges must address the problems of how to encapsulate or convert link layers of the LAN and the WAN.

This is usually not a good idea for larger networks as the number of ARP requests will increase. It also has to cope with the differences in speed and packet sizes of both the networks.

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

Describe Virtual Bridging.

A

Virtual Bridging allows more than one network to run traffic over a single physical network.

Virtual Bridging is normally engaged in switches and routers, rather than end hosts.

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

Describe how more than one network can run traffic over a single physical network.

A

Virtual Bridging allows this. A frame from LAN A to Switch A can be routed across the remote link to Switch B to LAN B.

Switch A places a Virtual Bridge Tag on the frame, containing a virtual LAN (VLAN) identifier. Switch B receives the tagged frame and sees which VLAN to route to. It removes the tag and passes the frame to LAN B.

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

What is the advantage that Virtual Bridge Tagging brings?

A

Virtual Bridge Tagging generalises more complicated virtual LANs and allows multiple networks to share the same infrastructure.

This can save a lot of money.

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

What is the difference between a Bridge and a Gateway?

A
  1. A bridge is always used to regenerate the signal and find the most efficient path to transmit the frame. A gateway is used to increase compatibility to establish communication between two networks using two different protocols.
  2. A bridge always operates on frames, and the gateway operates on packets.
  3. Bridge operates on the physical layer and data link layer, whereas a gateway can operate on all the layers of the OSI model.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a Gratuitous ARP?

A

A gratuitous ARP is an ARP reply when no one has asked. This is useful in specific scenarios, for example, if a new machine joins the network or an existing machine changes its IP address for some reason.

All machines on the network are free to read or reply to any ARP request and modify their ARP caches accordingly.

A gratuitous ARP also helps break old associations that are no longer valid but still cached.

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

Describe the fields of an ARP packet.

A

The Ethernet frame type for ARP is 0806. ARP fields are contained in the Ethernet Type field. An ARP packet consists of the following fields:

  1. Hardware type: 1 for Ethernet address
  2. Protocol type: 0800 for IPv4
  3. Sizes: sizes in bytes of the address fields, 6 for Ethernet, 4 for IP
  4. OP: 1 for a request, 2 for a reply
  5. Address fields: the data

In a request, the destination hardware field is not filled in, as this is what it is trying to find.

In a reply, the sender’s Ethernet address is the address it seeks.

17
Q

What is the overhead of using fragmentation?

A
  1. Performing fragmentation in a router slows down the processing of a datagram
  2. Extra overhead means more headers are being uses for a given amount of data
  3. Extra overhead means more segments are traversing in the network
  4. Higher possibility of losing or corrupting a datagram
  5. If a single fragment is lost or corrupted, the entire datagram must be retransmitted, which is a waste of bandwidth
18
Q

How are hosts able to determine packet sizes?

A

Hosts can determine packet sizes by MTU Discovery.

The Maximum Transmission Unit is the largest packet a host/network can transmit.

19
Q

How are hosts able to determine the fastest path to the destination?

A

Hosts are able to determine the fastest path in a network to the destination using MTU Discovery. The path MTU is the smallest MTU on the path from source to destination.

Path MTU can be determined by sending variously sized ICMP packets with DF flag set and watching for error ICMP Replies.