slides12 Flashcards
wat do routers do
The basic idea is that a packet does not know how to get from source to destination: this is the routers’ job (and it can be quite complex: see later)
is datagrm a synonym for packet
the word packet should only be used when the communication is reliable, e.g. IP over TCP. A datagram is used when the communication is unreliable, e.g. IP over UDP.
ip Version
Four bit field containing the value 4. A later version of IP (IPv6) contains 6
ip Header length
There are some optional fields, so the header can vary in size, so this is needed to distinguish the end of the header. Given as a number of 4 byte words. Four bits, maximum value 15, so maximum header length of 60 bytes
ip Type of service
Eight bits. To indicate to a router how this datagram should be treated in terms of cost, speed and reliability (if possible)
E.g., for audio it is better to get data through quickly rather than 100% reliably as the human ear is more sensitive to gaps than occasional errors
ip TOS field
Differentiated Services Field (DS field), is to inform routers on the best way to treat this datagram
This allows the implementation of Quality of Service (QoS)
ip Minimise delay
Do not hold onto this datagram longer than necessary, and perhaps prioritise it over others
ip Maximise throughput
Not quite the same as minimising delay, since collecting together several small datagrams and sending them off together may be more bandwidth efficient
ip Maximise reliability
Try not to drop this datagram if the router is becoming overloaded; drop another datagram first
ip Minimise cost
For this datagram cost is more important than reliability or speed. This datagram can be delayed if it makes transmission cheaper
EX problems with Explicit Congestion Notification
In routers and switches, active queue management (AQM) is the intelligent drop of network packets inside a buffer associated with a network interface controller (NIC), when that buffer becomes full or gets close to becoming full, often with the larger goal of reducing network congestion.
Use of ECN has been found to be detrimental to performance on highly congested networks when using AQM algorithms that never drop packets.[9] Modern AQM implementations avoid this pitfall by dropping rather than marking packets at very high load.
ip Total Length
Of the entire datagram, including header, in bytes. 16 bits, so giving a maximum size of 65535 bytes. Much larger than domestic networks need, but too small for high-speed networks
ip Identification
16 bits. A value that is unique to each (source) datagram, often incrementing by 1 for each successive datagram sent
Used in fragmentation to reassemble the fragments of a single datagram. All the fragments get their own IP header, but share the same identification
when is fragmentation useful
If a big datagram hits a part of the Internet that only allows small datagrams, there is a problem
ip Flags
Three bits: two used and one reserved
- RF. Reserved for later use, must be 0 (see RFC3514 for a
suggested use) - DF. Don’t fragment. If a host can’t (or doesn’t want to) deal with fragments this bit is set to inform the routers on the path to the destination. A router might choose an alternative non-fragmenting route, or simply drop the datagram and send an error message back to the source which can then send smaller datagrams
All hosts are required to be able to accept datagrams of 576 bytes - MF. More fragments. All fragments except the last have this set
ip Fragment Offset
13 bits, giving the offset divided by 8. E.g., value of 20 means an offset of 160
Every fragment has a copy of the original IP header, but with the various fragmentation and length fields set appropriately
who puts fragments back together into datagrams?
destination
cons of fragmentation
• Performing fragmentation in a router takes time
• More overhead as more datagrams for a given amount of
data
• More overhead as more datagrams are traversing the network
• More datagrams means a greater probability one will be lost or corrupted
• If a fragment is lost, the entire original datagram must be retransmitted: there is no mechanism in IP to indicate which fragment was lost
• Fragments are datagrams in their own right and can themselves be fragmented
what prevents fragmentation
Setting DF (Don’t Fragment) in the header prohibits fragmentation; if a router cannot avoid fragmenting it drops the datagram and returns a “fragmentation needed but DF set” error message back.
MTU
DF allows MTU Discovery. The Maximum Transmission Unit (MTU) is the largest datagram a host or network can transmit.
path MTU
The path MTU is the smallest MTU for the entire path from source to destination
how does a host find out about various MTU sizes
MTU Discovery works by sending variously sized datagrams with DF set, and monitors the errors returned
When a datagram reaches the destination with no fragmentation error we have found a lower bound for the path MTU
This bound is approximate as the network is dynamic and paths may change!
This is the approach of IPv6: don’t have fragmentation in routers, but require MTU discovery
how does ipv6 deal with datagrams that are too big
In IPv6 a datagram is never fragmented, but a router will always just drop a too large datagram and return an error message
MTU discovery is a required behaviour in IPv6, optional in IPv4
ip Time To Live
An eight bit counter used to limit the lifetime of a datagram
-1 for every hop
maximum path of length 255
Why doesn’t everyone simply put 255 into the TTL field?
because OSs decide
ip Protocol
This eight bit field connects the IP layer to the transport layer. This is a value indicating which transport layer to pass the datagram to. For example, UDP is 17 and TCP is 6
ip Header checksum
As for the Ethernet header, this is a simple function of the bytes in the IP header. If the checksum is bad, the datagram is silently dropped. A higher layer must detect this and perform whatever action it needs. Recall that the IP layer is not guaranteed reliable
The checksum includes the TTL field so it must be recomputed and rewritten in the datagram by each router the datagram passes through
ip Source and Destination Address
32 bit numbers that uniquely determine the source and destination machines on the Internet