Chapter 11: Digging into Packets, ICMP, Port Numbers, and more

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/76

encourage image

There's no tags or description

Looks like no tags are added yet.

77 Terms

1
New cards

What is IPV4?

A Network-Layer protocol whose job is to take data, put it into packets, and move it through routers to deliver it to its destination.

2
New cards

Is IPV4 reliable?

No, IPV4 is not reliable at all. It doesn’t guarantee that the packet arrives, and it doesn’t notify the sender if something goes wrong.

3
New cards

Why would anyone design a Protocol like IPV4 if it’s so bad? Why doesn’t it just guarantee successful transmission?

Because IPV4’s job is to make sure a network is simple and fast; So whether or not those packets actually deliver is none of its business.

4
New cards

What does “best-effort” mean?

It means that a network does its best to deliver a packet, but that it offers no guarantees.

It’s similar to Canada Post in this regard.

5
New cards

If reliability is necessary for processes like online banking and government documents, but IPV4 is unreliable, then who provides that reliability?

The TCP (Transport Control Protocol) along with ICMP (Internet Control Message Protocol) provides that reliability.

The Transport Control Protocol fixes any issues relating to out of order or missing packets at the Transport layer.

6
New cards

What is a datagram?

The packet used by IPV4. Or in other words, the fancy name for a packet at the network layer.

7
New cards

What are the two main things that a datagram/packet contains?

A header and a payload.

8
New cards

What is a Payload?

A Payload is the actual message being sent, like “Hello Lachesis”.

9
New cards

Describe in simple terms what the Header contains

It mostly contains information about where a packet should be delivered.

10
New cards

Draw a diagram of what the Header stores

11
New cards

What does TTL (Time to Live) represent?

It represents the remaining lifetime of a packet. Each time the packet passes through a router, it decreases TTL.

12
New cards

Explain what TTL is used for?

TTL is used for routing mistakes where a packet keeps getting sent back and forth between two routers, like this:

Router A → Router B

Router B → Router A

Router A → Router B

This is a problem because it means that the packet will be infinitely caught between these two routers. So TTL is supposed to help prevent this by killing the packet after a certain point.

For example, TTL might start out at 5, but after the first router, TTL = 4, after the second router, TTL = 3, and eventually TTL = 0. When TTL reaches 0, the packet gets destroyed to prevent it from looping infinitely between two routers.

13
New cards

What is the Checksum for?

The Checksum is for checking to see whether or not the header of a packet has been corrupted.

14
New cards

In IPV4, what size are Header Chunks measured to be?

Why are they measured this way?

Header Chunks are measured to be 4 byte chunks. Meaning a single row of a header is equivalent to 32 bits, or 4 bytes.

They are measured this way in order to maximize the total number of integers that can be represented.

15
New cards

What is a word in data communications?

A word refers to the smallest chunk of data a processor can process at once.

In the case of IPV4, the smallest chunk of data a processor can handle is 4 bytes (or 32 bits), which represents the number of bits in a single Header Chunk.

In IPV4, each row is a single word, or a set of 4 bytes.

16
New cards

What is the minimum valid length (in bytes) for a header?

Well, since there are 5 rows in a header, and each row has 32 bits, this means:

32 × 5 = 160 bits total.

Which also means: 160 / 8 = 20 total bytes.

17
New cards

If we are told that a Header has a length of 4 (meaning it has 4 rows) what does this actually mean?

This does not mean that the header has a length of 4 bits or 4 bytes, it means that the header has a length of 4 words (or 4 rows).

And since each word is equal to 4 bytes (or 32 bits), it means that we have a total of 16 bytes (4 bytes x 4) (or 128 bits).

This would be invalid because each header needs to have at least 5 rows.

18
New cards

What does the Header Length field of an IPv4 packet tell you?

It tells you the length of the entire packet (how many rows).

19
New cards

An IPv4 packet has arrived with the first 8 bits as 01000010. The receiver discards the packet. Why?

We know that the first 8 bits of a header represent the Version Number, and then the Header Length.

So this means that 0100 corresponds to the Version Number, and 0010 corresponds to the Header Length.

If we convert these values to decimal, it means that the Version Number is 4, and the Header Length is 2.

But a Header Length of 2 is invalid. Because it means that there are only 2 rows/2 words, and since each word contains 4 bytes, this means we have: 2 × 4 = 8 bytes. This is not allowed because the minimum header length is 20 bytes.

20
New cards

What happens when a router receives a frame?

When a router receives a frame, it must remove the outer protocol layer, or in other words, remove the frame through decapsulation.

Then the router extracts the IPV4 datagram from the frame, and examines its destination IP address to decide where it needs to go next. Afterwards, it creates a brand new frame.

21
New cards

Why does the router create a brand new frame?

It creates a brand new frame because the frame needs to be compatible with the data link layer protocol at the next network. Because the incoming frame might be in an Ethernet frame format, and the next network might expect a WAN Frame, it’s important to create a brand new frame to account for these issues.

22
New cards

Why do different frame formats exist?

Because different networks rely on different technology. For example: Ethernet, Wi-Fi, and WAN technology, to name a few.

23
New cards

What is MTU?

MTU is Maximum Transmission Unit.

It refers to the maximum amount of data/the maximum payload size a frame can carry. Since a frame is like a box for a datagram, the MTU describes the maximum size of that box, and therefore it also dictates how big the datagram can be.

24
New cards

If a Frame has an MTU of 1500 bytes, can a 5000 byte datagram fit?

No, it would be too large.

25
New cards

The average LAN MTU is 1500 bytes. Explain what this means.

This means that this given frame can only carry a payload size of up to 1500 bytes.

26
New cards

Why might MTU be a problem in the following scenario?

What happens as a result?

You want to send a datagram that is 1400 bytes in size.

The first network accepts an MTU of 1500, the second network accepts an MTU of 1400, and the third network accepts an MTU of 500.

The problem is that the datagram will only be able to fit through networks A and B, but not network C. As a result, this creates fragmentation, where the packet/datagram must be broken up into packets in order to make it fit into the other network.

27
New cards

What happens to the header during fragmentation?

During fragmentation, each fragment receives its own complete header, and each fragment also receives a piece of the payload/message.

For example:
Fragment One: Header + Piece 1
Fragment Two: Header + Piece 2

In a sense, each fragment becomes its own mini valid datagram.

28
New cards

Can Fragmentation happen multiple times?

Yes, it can happen multiple times. Because even if a datagram is fragmented once, perhaps another network has an even smaller MTU. In that case, it would be necessary to fragment again.

29
New cards

Who performs fragmentation?

The source host, or the router performs fragmentation. Either one can do it. The idea is that any devices that discovers the datagram is too large can fragment it.

30
New cards

Who reassembles the fragments?

The destination host.

31
New cards

Why doesn’t every router reassemble the fragments?

Not every router reassembles the fragments because it would be extremely inefficient.

If you had 6 different routers, and each router need to reassemble the fragments, then fragment then again afterwards, it would be incredibly impractical.

32
New cards

Which fields change during fragmentation?

Only some of the fields part of the header change.

This includes the Flags, which indicate whether or not more fragments exist, the Fragment Offset, which tells you where a fragment belongs in the original datagram, and the Total Length field, because obviously, the total length of the header changes when you alter the header.

33
New cards

Why must the checksum be recalculated after fragmentation?

It must be recalculated because the checksum is responsible for protecting the header and making sure it hasn’t been corrupted. So if the header changes, the checksum needs to be recalculated in order for it to be correct.

34
New cards

How does the destination host know which fragments belong together when it needs to reassemble the pieces?

It knows based on a few different header fields: The Identification number, the Flags field, and the Fragment Offset.

35
New cards

What is the identification number for?

It is a number used to identify all of the fragments belonging to the original datagram.

For example, if the original datagram had an identification number of 500, then after fragmentation, each fragment will also have an ID of 500, to indicate that they all correspond to that original fragment.

For example:
Fragment 1 would have an ID of 500
Fragment 2 would have an ID of 500, etc.

36
New cards

What is contained within the Flags field? How many bits is the Flags field?

The Flags field contains 3 bits. An unused bit, a D bit, and an M bit.

The D bit is the Don’t Fragment Bit

The M bit is the More Fragments Bit

and the last bit is unused.

37
New cards

What is the D (Don’t Fragment) bit for?

It is a bit that tells routers whether fragmentation is allowed.

If the bit is a 0, it means that fragmentation is allowed. If the bit is a 1, it means fragmentation is not allowed.

38
New cards

What happens if we have a datagram that is too large and that needs to be fragmented in order to successfully move on to the next network, but the D bit of the Flag field is 1?

Because D = 1, Fragmentation is forbidden. So the router discards the datagram and sends an ICMP error message.

39
New cards

What is the M (More Fragments) bit for?

It is a bit that helps identify whether or not this is the last fragment. If M = 1, it means more fragments remain. If M = 0, it means this was the last fragment.

40
New cards

Why do we need M to identify the last fragment?

We need M so that the destination knows when all of the fragments have arrived.

41
New cards

What is in the Fragment Offset?

Information that tells us where a fragment begins within the original data.

For example, you might receive the fragments: HELLO SOFIA TODAY, and you want to know the position or order that the message should be assembled in, which is the type of information provided by the Fragment Offset.

42
New cards

What is Fragment Offset measured in? For example, how would you interpret a fragment offset of 140?

Fragment Offsets are measured in units of 8 bytes. Each fragment offset represents 8 bytes.

As a result, a fragment offset of 140 for a specific fragment means that that fragment starts at byte 1120 in the original datagram (140 × 8 = 1120).

43
New cards

If the original data contains 3000 bytes, and the Fragment Offset is 200, what does that tell us about where the fragment starts?

It tells us that the fragment starts at 200 × 8 = Byte 1600.

44
New cards

How come Fragment Offset is measured in units of 8 bytes? Why isn’t offset just measured in bits? The Offset field already contains 13 bits, isn’t that enough to represent all the possible integer values?

Offsets are measured in groups of 8 bytes, meaning 1 offset = 8 bytes.

This is because developers realized that 13 bits wasn’t enough to store all the possible integers for offsets, since 213 = 8192 only provides a fraction of the total payload size available.

After scaling up the offset in this way, they found that it now matched the maximum payload size of 65,528 bytes.

45
New cards

What does a Fragment with an Offset of 275 mean?

It means that the fragment starts at byte 2200 (275 × 8)

46
New cards

Let’s say you’re trying to deliver a packet from Sofia to Lachesis, and somehow, there is an issue with one of the routers, and the packet cannot be delivered. What does IPv4 do in this scenario?

IPv4 doesn’t do anything in this scenario. It just drops the packet without saying anything to the sender. So Sofia will have no idea that her packet didn’t send.

47
New cards

What is one of the major weaknesses of IPv4?

The major weakness of IPv4 is that it is incapable of reporting on errors. It is only capable of defining the rules for forwarding packets, routing, and delivering them.

48
New cards

What does ICMP stand for?

ICMP stands for Internet Control Message Protocol.

49
New cards

What is ICMP responsible for doing?

ICMP is responsible for sending messages about what went wrong with a packet.

It notices that something went wrong with the packet, so it creates an ICMP message, then sends it back to the source host.

50
New cards

What are some of the problems that ICMP addresses and sends error messages about?

  • Routers being unable to find a route, and discarding a packet

  • TTL reaching zero, resulting in the packet getting destroyed

  • Fragments that have mysteriously disappeared and now can no longer be reconstructed into the original datagram by the destination host


51
New cards

Is ICMP a Network-Layer protocol?

Yes, it is a protocol that exists at the Network-Layer, but it is not part of the IPv4 protocol; It is its own entirely separate protocol.

52
New cards

How can a router tell that a datagram contains ICMP?

It can tell based on the IPv4 header field called the Protocol.

When Protocol = 1, it knows that the payload of that datagram is ICMP.

If the Protocol = 0, it means it is not ICMP.

53
New cards

What are the 2 types of ICMP messages that exist? Name them & describe them.

Category 1: Error Reporting Messages
These are used for describing problems with the network, like “The packet couldn’t be delivered”

Category 2: Query Messages
These are used for asking a device whether or not it is still alive/intact, like: “Are you still responsive? Can you still be reached by the sender?” etc.

54
New cards

What information is inside an ICMP packet?

Two fields: Type and Code.

Type represents the larger category of the message, while Code gives a more detailed explanation of what the problem actually was.

For example:
Type: Destination Unreachable
Code: Host Unreachable

55
New cards

What is a Type=3 ICMP message?

An ICMP message which says that the packet could not reach its destination, or in other words, the message: “Destination Unreachable”.

56
New cards

When might you receive a destination unreachable message when using the internet?

When you try to visit a website whose server is down.

For example, you might try and visit www.disney.com, but if their server is down, you’ll just receive a message that says: Destination Unreachable.

57
New cards

What does an ICMP message with a Type = 11 and a Code = 0 mean?

It means that the packet’s TTL (Time left to live) reached zero. Specifically, it is the message:
ICMP Time Exceeded.

58
New cards

Why would TTL (Time Left to Live) ever reach zero?

TTL could reach zero if a packet is caught between two routers and just constantly looping back and forth between routers. With each pass through a router, TTL decreases by 1 until it reaches 0, to prevent the packet from infinitely looping.

59
New cards

What is a Type = 8 Echo Request?

An Echo Request is a type of query message sent to verify whether or not the device is still there. An echo request just asks a device: “Hello? You still dere? Please answer”

60
New cards

What is an echo reply?

An echo reply is when the receiving device answers with a Type = 0 message, which just confirms that it is alive.

61
New cards

Which layer is responsible for making sure data is sent to the correct program?

The transport layer.

62
New cards

Compare what the network layer does in comparison to the transport layer.

The network layer figures out which computer a packet should arrive at, but the transport layer actually figures out which program the data should arrive to.

63
New cards

What is a process?

A process is just any running application. This could mean: Discord, Zoom, Facebook, etc.

64
New cards

What kind of communication does the network layer provide?

The network layer only provides host-to-host communication, because it is only responsible for making sure a packet was delivered from a source host to a destination host.

65
New cards

What kind of communication does the transport layer provide?

Process to process communication. Example: Chrome on My laptop communicating with google’s web servers.

The application (Chrome) is communicating to a web server.

66
New cards

Why is Process to Process communication, done by the Transport layer, also called End to End logical communication?

It is also called end to end logical communication because the only communication that matters is the one that is happening between Chrome & Google’s Web Servers, not any of the intermediates (like the routers) in between.

67
New cards

Why don’t routers need to use the transport layer?

Because the router doesn’t care about whether a piece of data is destined for Google, Zoom, or Discord, it only cares about the destination IP address so it can forward the packet.

68
New cards

Which layers do the transport layer work off of?

The transport layers work off of the network layer and below.

69
New cards

Name the services provided by the transport layer.

  1. Process to process communication

  2. Port Numbers

  3. Encapsulation & Decapsulation

  4. Flow Control

  5. Error Control


70
New cards

What does the Client/Server Model Describe?

It describes a model in which you have a Client, and you have a Server. A client is usually the program requesting a service, for example, Chrome, Netflix, Discord, and a server is usually the program providing a service, such as Google’s Web Services, The Netflix Server, Discord’s Servers etc.

71
New cards

You open the homepage of google on your laptop. State which is the client and which is the server.

Client = Your browser

Server = Google’s Web Servers

72
New cards

What are port numbers for?

Port numbers are for identifying a process, specifically, an application.

73
New cards

How many port numbers exist?

There are anywhere from 0 to 65,535.

74
New cards

What are well-known port numbers?

Port numbers that are frequently used over and over again by certain applications. They are port numbers that are typically permanent, and reserved for a specific purpose, and tend to range from 0 to 1023.

75
New cards

What is the standardized port for accessing a web server?

Port 80 (or Port 443 on HTTPS).

76
New cards

What is an Ephemeral Port?

A port that is only assigned for a short, temporary period of time in order to conduct a short-lived process like connecting your Chrome web browser to google’s servers. It is randomly chosen.

77
New cards

Why are client ports temporary?

Client ports are temporary because usually client connections are short-lived and only needed for a single, temporary communication process. We want them to be temporary so that they can be easily recycled, because there are only a limited number of port numbers.