Distributioned Systems & Networks Flashcards
What are the 5 network layers in Tanenbaums books model
Application
Transport
Network
Link
Physical
What headers does the Transport layer add
TCP or UDP headers
What headers does the Network layer add
IP Headers
What headers does the link layer add
It depends on the medium as it will add whatever headers are required for the physical medium
What is the purpose of the link layer, from a high level
To shield the upper layers from the specific connection type, and then to transmit bits in the form of frames
What addressing form is used at the link layer
MAC (Medium Access Control Address)
What IEEE standard defines transmission for WIFI
IEEE802.11
There are a large number of physical medium types, name some
Important ones:
+ Coaxial Cable
+ Twisted pair
+ Power line
+ Fibre optic
+ Wireless
Minor ones:
+ Laser
+ Sound
+ Ultrasonic
+ Pulses
+ Radar
What is the function of the link layer
The link layer:
+ Transmits frames over physical media, encapsulating IP Datagrams into link layer frames
+ Receives frames and parses the IP datagrams up the stack
+ Detects and handles transmission errors
There are many standards which have been defined and have evolved over the years
When being encapsulated by the link later, what do packets from higher levels become and get referred to as
Packets get encapsulated into FRAMES as PAYLOADS, they are prepended with headers and appended with trailers
What level of encapsulation differs based on the type of the physical layer
Data frames vary depending on the physical layer, for example, an ethernet frame will have a different form than a WiFi or a Fibre frame
What is the purpose of flow control
Flow control regulates the flow of data to avoid swamping slow receivers from fast senders
What are two major methods of flow control at the link layer
+ Messages sent to the sender saying more data can be sent
+ Rate based with an agreed speed
What are the three general link layer models, giving an example for each
+ Connectionless, no acknowledgements - i.e. wired ethernet
+ Acknowledged, connectionless service - i.e. Wifi (IEEE802.11)
Acknowledged, connection-oriented - i.e. satellite
What does it mean for a link layer model to be called Connectionless, no acknowledgement
Connectionless means that no signalling path is established in advance.
No acknowledgement means frames are sent and they may or may not be received by the destination.
What does it mean for a link layer model to be called an Acknowledged Connectionless service
This is used to allow frames to be sent without first setting up a connection, and then allows the acknowledgement of these frames
What does it mean for a link layer model to be called an acknowledged connection-oriented service
This is used to allow a connection to be established between two machines before frames are sent, these frames can then be acknowledged when they are received
What does ARQ Stand for?
Automatic repeat reQuest.
What is stop and wait ARQ
Stop and wait ARQ (Automatic Repeat reQuest) is a link layer ACK handling strategies which sends a frame and waits for an ACK before sending the next frame. If it does not receive an ACK then the frame is re-transmitted
At the link layer, when is an ACK not sent?
An ACK is not sent if the frame is lost or damaged (checksum doesn’t compute)
At the link layer, what is Go-Back-N ARQ
Go-Back-N ARQ is a method of handling acks which will send multiple frames (up to the window size) before it receives the first ACK, it uses sequence numbers on the frames to ensure it gets frames in the correct order.
If a frame is received out of order it gets discarded, and an ack is then sent for the last correct, in order frame and the sender re transmits from that point
What is selective repeat ARQ at the link layer
Selective repeat ARQ is similar to Go-Back-N ARQ, however it only re-transmits lost frames meaning that it is acceptable for frames to be received out of order and buffered
What is the job of error detection and correction at the link layer
To detect errors and provide a line “free of errors” to the network layer
What is parity bit
Parity bit is an error detection method where a bit marks “is the number of 1’s even or odd”, but this does not reveal all errors
What is CRC
CRC, or Cyclic Redundancy Check, is a error detection method which holds a checksum field in the frame, this is calculated on both ends and is compared
This can be used on the link layer and other layers - for example, IPv4 packets hold such a checksum
What is forward error correction
Forward error correction includes error-correcting codes in frames which can be used to detect AND fix errors in the transmitted data
Does Ethernet use ACKs, why
No, because it would be unnecessary overhead when ethernet is already reliable
What does the process of framing refer to at the link layer
Framing the process is adding indicators of where the frame starts and ends to the link layer data bits
What is one approach to framing at the link layer, explain
Using FLAGS
+ Using a predefined flag, append the FLAG byte value to mark the start and end of the data
+ If the FLAG occurs in the actual data, use an escape byte
+ When receiving ignore the first escape byte
What does the MAC protocol manage
Access to and from the physical medium, this is typically specific to the type of physical layer
What does CSMA/CD Stand for and what is its purpose
CSMA/CD Stands for Carrier Sence Multiple Access with Collision Detection
It is used when using a single shared media in order to ensure that only one one sender is transmitting at any time
How does CSMA/CD work
Sender listens to see if the media is busy, if it is wait
When the channel is free transmit, while you transmit, listen and stop if a collision occurs
Back off before retransmitting if a collision is detected
How does exponetial back of in CSMA/CD work
When a collision is detected for the first time, back off for a random amount of time between MIN and x.
When you transmit again, if another collision is detected increase x (i.e. double it) and wait this random amount of time again
Why doesn’t WiFi use CSMA/CD
WiFi doesn’t use CSMA/CD because WiFi devices generally can’t send and listen at the same time. There is also the “hidden node” problem in which two devices can see the access point but not each other
What does WIFI use instead of CSMA/CD, and what does it stand for
CSMA/CA Carrier Sence Multiple Access with Collision Avoidance
How does CSMA/CA work with RTS/CTS
When a frame needs to be transmitted wait until the channel is idle.
When it’s free transmit a Request to Send, if a Clear to Send is received back transmit the data, otherwise wait a random back off time
What TCP/IP layer is called the network layer by the OSI model
The Internet layer
What OSI Layer is called the internet layer by the TCP/IP model
The network layer
What is the layer above the link layer
The network/Internet layer
What does the Internet layer provide
Unique addressing and next hop routing
What header does the internet layer add to a packet
The IP Header
Name the three key properties of the internet protocol
Packet switched - Its connectionless
Unreliable - Packets are sent on a best effort basis
Routed - Routers use a routing table to determine the path
What process does store and forward packet switching refer to
Store and forward packet switching refers to the process of sending a packet to the nearest router, which should then parse it onto a router from its routing table. This should result in packets eventually arriving at the end process.
What do Quality of Service methods do
They prioritise certain traffic
What does fragmentation refer to
Fragmentation is the process of spliting Protocol Data Units into smaller Protocol Data units for transmission so they are below the MTU value
What Does MTU stand for and what is it
MTU is the “Maximum Transmission Unit” and is the maximum size packet which the physical connection is able to transmit.
Protocol Data Units which are larger than the MTU must be split into smaller packets
What are the 6 main protocols which operate at the internet layer
Internet protocol:
+ IPv4
+ IPv6
Control and diagnostic protocols:
+ ICMP
+ ICMPv6
Encryption and Security
+ IPSEC
Establishing of IPv4 multicast groups
+ IGMP
How can we simplify an IPv6 address
Omit the leading 0s
Replace a single set of repeated 0 blocks with ::
Simplify 2001:0630:00d0:f500:0000:0000:0000:0064
2001:630:d0:f500::64
How does fragmentation differ between IPv4 and IPv6
IPv4 allows packets to be fragmented at any routing hop, while IPv6 only allows packets to be fragmented by the sending host
This means, if needed, IPv4 packets can be re-assembled at intermediate routers
It also means that IPv6 must use Path MTU discovery before sending
What does the following tell you about the network, and what is the /48 called:
2001:650:d0::/48
That the first 48 bits are common to the network,
/48 is called the prefix length
What does the following tell you about the network, what is the /16 called, and how can it also be represented
152.78.0.0/16
The first 16 bits are common to the network, this is called the subnet mask
This can also be represented ass 255.255.0.0
What was the original three classes of IPv4 address allocation, and why was it inefficient
Class A: /8 prefix with 16 million addresses
Class B: /16 prefix with 65000 addresses
Class C: /24 prefix with 256 addresses
This was inefficient as, say you needed 258 addresses, you would get a /16 allocation with 65000 addresses consuming large ammouts of address space
What does CIDR stand for and what did it allow
CIDR stands for Classless Inter Domain Routing and allows for variable length prefixes to be used (in place of the 3 original allocation classes). This helped reduce IPv4 address consumption
What does subnetting allow
Subnetting allows us to limit the propagation of ethernet broadcast traffic across a network and put hosts into segments
This allows for larger IP allocations to be logically divided by, for example, buildings
For a /24 IPv4 subnet, how many total addresses are there and how many are available
256 Total addresses
253 are usable as .0 or .255 are reserved, and one (often .1 or .254) is used for the router
Given the IPv4 allocation of 152.78.70.0/23 and the need to make one subnet for 200 devices and two others for 100 devices each what is a possible allocation scheme
200 devices require a /24 subnet mask (max), giving the subnet 254 addresses
100 devices require a /25 subnet mask (max), giving the subnet 126 address
So one example is
152.78.70.0 /24 (152.78.70.1 -> 152.78.70.254)
152.78.71.0 /25 (152.78.71.1 -> 152.78.71.127)
152.78.71.128/25 (152.78.71.129 -> 152.78.71.254)
What is the smallest IPv6 prefix for hosts
/64 as there is no real need to go bigger or smaller
When is a router needed in a network
A router is needed any time there is a change in the address space
What is RFC 1918
RFC 1918 is the name of the memo which defines the private address space. These are IPv4 addresses which are for internal use within networks and are not globally routable.
What are the 3 address spaces defined in RFC 1918
10.0.0.0/8 with 16 million addresses
172.16.0.0/12 with 1 million addresses
192.168.0.0/16 with 65000 addresses
What does NAT stand for and what is its purpose
NAT stands for Network address Translation, although it is commonly also used to refer to Network Address and Port Translation (NAPT)
NAT allows one global IPv4 address to be shared between multiple hosts, for example, a home network will have 1 IPv4 from the ISP and then use RFC1918 internally
What does CGNAT stand for and what does it allow
Carrier Grade NAT allows sharing global addresses between customers who get private addresses from a special range
Customers then NATs that address to RFC1918
This should be done with the 100.64.0.0/10 block, but some abuse RFC1918
What does routing describe
Routing describes how packets should move between different subnets
At what layer is routing considered
The Internet/ Network layer
What two possible places can a host send a packet too
Directly to a destination if its on the same local subnet
A router
How would you signify that the first 64 bits of a IPv6 address identifies the subnet
/64
How would you show a subnet mask of 255.255.255.0 in CIDR notation
/24
Where is the information to build a routing table taken from
DHCP or IPv6 RA
What does a routing table include
Destination IP prefixes and the interface or next hop to use
The local subnet which the host is connected to
To default route
What routing in the routing table will be picked first
Thr route with the longest prefix will always be picked first, if two routes have the same prefix then that with the lowest metric is picked first
What does prefix aggregation allow for
Prefix aggregation allows subnet prefixes to be aggregated with those of adjacent subnets
What do routing protocols allow for
Routing protocols allow for routers to create their own routing tables
What is an Autonomous System (AS)
An AS is a large network or group of networks with a unified routing policy, these make up the internet
What is an ASN
An ASN is an Autonomous System Number and is assigned by a Regional Internet Registry, each AS needs its own ASN
What are the three general categories of Autonomous Systems
+ Multihomed
+ Transit
+ Single-homed/ stub
Where are Interior gateway protocols used
Interior Gateway Protocols are used within an Autonomous System, such as within a corporate network
Where are Exterior gateway protocols used
Exterior gateway protocols are used between autonomous systems
What are two types of Interior Gateway Protocols
+ Distance Vector - Talk only to neighbouring routers.
+ Link state - Talk to all routers on the network.
How do Distance Vector Interior Gateway Protocols work
Each router talks only to directly neighbouring routers
They then exchange the best route information for any known prefixes with direct neighbours
How to Link State Interior Gateway Protocols work
Each router talks to all other routers to establish full knowledge of the routers and topology in a site
Routers flood information describing their connected neighbours around the entire site network
RIP Is an example of a routing protocol. What are 2 of its limitations
Metrics are simple hop count values limited to 15
Updates are not acknowledged
Updates are only sent every 30 seconds
Routers don’t have knowledge of the network topology
Authentication is MD5 which is broken
What are the 3 steps for link state routing
- Discover neighbours and determine the cost metric
- Flood messages with this information to all routers
- Use received messages to build topology, computing shortest paths for prefixes served by any router
These messages are sent periodically or when a change in connectivity is detected
What is the advantage of Link State Routing over Distance Vector
Link state converges faster, allowing changes of topologies to be detected in seconds
Link state is better at avoiding loops as every node knows everything
How does inter site routing between AS’s work
AS’s advertise their network prefixes to neighbouring networks
AS’s can also offer to transit to other AS’s
BGP is a Distance Vector like exterior routing protocol, what additional information prevents loops
As the path is sent when routes are advertised we can detect and prevent loops
What are the three downsides of BGP
+ BGP Relies on trues
+ BGP Is too slow and takes a lot of effort to update
+ Routers have limited BGP Routing table sizes
Where does a host on a LAN or Subnet send packets (To IP’s not in its subnet)
A Default Router
What does an enterprise site network use to connect subnets
A Routing Protocol
What does UDP stand for
User Datagram Protocol
What does TCP stand for
Transmission Control Protocol
At what network layer do UDP and TCP function
The Transport Layer
What Transport Layer protocol supports Multicast
UDP
How is a TCP connection established
A three-way handshake is used:
+ SYN is sent by the client with random sequence numbers
+ SYN-ACK is sent back by the server
+ ACK is sent by the client meaning a connection is established
What protocol is used by TCP to control the sending rate, how does it work
Sliding window protocol:
+ The receiver has a limited incoming buffer size
+ The sender should not send data unless the receiver indicates it has space to receive
+ Otherwise the packet would need to be resent later
What Transport layer protocol should be used for web streaming ( not live)
TCP - this allows for buffering ahead of the video
What does ICMP stand for, and what is it used for
Internet Control Message Protocol is used in both IPv4 and IPv6 for information and error messages
For IPv6 only it is also used for router advertisement and neighbour discovery
What is multicast
Multicast is One to Many communication, packets are only sent to hosts who are interested in them
This is required for IPv6 and an add-on for IPv4
What is ARP?
Address Resolution Protocol is used to map an IPv4 address on the local subnet to a MAC address
The host looking for a MAC address broadcasts an ARP “who has request” and the target sends a unicast reply to the requestor
What does DHCP stand for and do
Dynamic Host Configuration Protocol automates the process of Address configuration for IPv4
What is NDP
Neighbour Discovery Protocol Maps IPv6 addresses on the local subnet to Mac addresses
It uses ICMP and multicast
What are the steps for DHCP
When a host connects to a network it broadcasts DHCP DISCOVER
The DHCP server reserves an address and replies with a DHCP offer
The client then needs to DHCP REQUEST the address
The server sends a DHCP ACK containing the lease duration and config
What does SLAAC stand for and allow
StateLess Address AutoConfiguration allows a host to autoconfigure basic network settings without a DHCPv6 Server. The RA specifies whether this should be used or not
How does a host using SLAAC build its address
A 64 bit prefix determined from a router assignment
A 64 bit generated host segment