Flashcards
The Network Layer (5)
Cards in this deck (42)
- 1Network Layer vs Data link layerNetwork layer uses services provided by data link layer for the routing of packets through the network. Routers in the network layer send packets over multiple networks.
- Switches can connect 2 LANs with each other but the assumptions is that these 2 LANs are built using same technology. Switches do not work across more than one link layer technology (can’t translate between different technologies)
- Switches do not scale to a large network (physical addresses are flat, forwarding tables will become huge with lots of entries)
- Broadcast technology is mainly used for LANs and doesn’t suit Internet
- Switches do not perform traffic control
This is why use the network layers (routers, IP addresses, packets) instead of just building networks with switches and sending frames between hosts. - 2Network layer 4- Provides independence from subnet technology (routers translate between technologies)
- Provides uniform numbering scheme for network addresses across LAN and WAN (scale better, routing tables have an entry per network)
- Uses subnet that is made up of routers connected using point to point links so main technology is Point to Point
- Knows the topology of the network (in subnet we have more than one route to go from source to destination) so can plan routes and deal with congestion - 3Roles of the Network layer: priveds following to transport layer 3- Internetworking: connects heterogeneous subnets (potentially with dif datalink protocols)
- Routing and forwarding: fills in routing tbale and forwards packets to right destination
- Congestion Control: controls flow of data when too many messages in transit - 4Network layer offer 2 types of services- Connection Oriented: virtual circuit
- Connectionless: Datagram - 5DatagramIn datagram subnet, no routes are worked out in advance. Ie IP protocol
Each packet contain the source address and destination address. At each node, packet is sent int the direction of its destination according to current routing table of the node. Routing table of a node can be updated through time. - 6Virtual CircuitWhen connection established, route from source to destination is chosen as part of the connection setup and remembered by all routers from source to destination. Ie MPLS (multi-Protocol Label Switching) protocol sends packets along established paths.
Each packet contains a VC number indicating their order on the connection. Once connection is established the packets are going through, independently from routing table updates. - 7Comparison of datagram and virtual-circuit networks for issues: circuit setup addressing state information routing effect of router failures quality of service + congestion controlcircuit setup: d: not needed, vc: required
addressing: d each packet contains full source and destination address, vc: each vc requires router table space per connection
state information: d: routers do not hold stat info about connections, vc: requires router table space per connection
routing: d: each pakcet routed independently, VC: route chosen when vc is set up; all packets follow it
effect of router failures: d: none except packets lost in crash, vc: all vcs that passed through failed router terminated
quality of service + congestion control: d: difficult, vc: easy if enough resources allocated in advance for eac vc - 8Networks differin: 5- Service offered (connection vs connectionless)
- Protocols (IP, MPLS, SNA…)
- Addressing (flat vs hierarchical)
- Packet size (each has own max)
- Flow control mechanisms & more - 9Internetworking Can be based on 2 things:: joins multiple, different networks into a single larger network.
Can be based on a common network layer (mainly IP) or Tunneling - 10Based on common net network layer - IPif source and destination networks use different technologies. Routers will decapsulated packets and use their headers to decide on destination. Once destination is identified they will re-encapsulate packet according to protocol of next network.
- 11Tunnelingconnects 2 networks through a middle one –Packets are encapsulated over the middle. This approach only works if source and destination networks are using same technology but network in middle uses another technology.
- 12Packet Fragmentationif incoming packet is too large for intermediate networks will be broken down by routers. Detrimental to performance and a whole packet is lost if any fragments lost.
- 13Path MTU (Maximum Transmission Unit)Each network or link imposes max size on packets
- 14Source can get rid of fragmentation using Path MTU discovery:determines MTU size on network path between 2 IP hosts, usually with goal of avoiding IP fragmentation.
- 15Steops of Path MUT dsicovery (in IPv4)1. Each IP packet is sent with its header bits (DF bit (Don’t fragment)) set to indicate that no fragmentation is allowed. 2. If router receives packet that is too large, generates an error packet, returns it to the source and drops the packet. 3. When source receives error packet, uses the info inside to re-fragment the packet into pieces that are small enough for the router to handle. 4. The process is repeated if a router further down the path has an even smaller MTU (until MTU becomes small enough to traverse the entire path without fragmentation). In IPv6 happens by default.
- 16The Internet Protoc (IP)Internet is a very large collection of different kinds of subnets. IP gives impression of single global net. IP provides delivery of packets from one host in the Internet to any other host in the Internet even on different networks (and dif protocols). Internet packets may be up to 64 kilobytes in length. Packet is made up of: Header (for addressing and routing) and a Payload (segment from transport layer).
- 17IPv4 formatheader is 4 bytes. Time-to-Live: Hop count, decremented each time packet raches a new router. When ho count =0, packet discarded. DF: Don’t Fragment. Packets must be sent in one piece. Source and Destination Addresses: uniquely identify sender and receiver of packet (32 bits each)
- 18IPv4 addressesIP address uniquely identifies any computer on the Internet. 32 bits long (4 bytes). Each byte is written in decimal (dotted decimal notaiton) ie 128.195.1.80
0.0.0. lowest to 255.255.255.255 highest. Each address consists of netid, hostid pair. All IP hosts on same IP network must have same netid (to reduce size of routing table) - 19IPv4 Classful Addressing divided into 5 classes to cope with dif network sizes- Class A: Very large organisations 16 million hosts per network (126 max): 1/7/24 (out of the 32 bits divided into _, network, host)
- Class B: For large organisations 65 thousand hosts (16,384 max): 2/14/16
- Class C: For small organisations 254 hosts (2 million max): 3/21/8
- Class D: for special case – multicast: 4/28
- Class E: reserved: 2/28
- Broadcast: 255.255.255.255 all 1’s - 20IPv4 Default Subnet Mastfor classes (A,B,C) splits network ID and hosts ID. Subnet mask is represented with all 1’s in network portion and all 0’s in host portion. As such adding mask to address (and) filter network id.
- 21IPv4 Classless Addressing: to reduce wastage of PIv4 addresses, classless addressing (CIDR Classless Inter Domain Routing) introduced. Used to assign ‘right size’ to an IP network. Addresses are still allocated in blocks called prefixes. Notation is (IP address/length) where: IP address: 32 bit address. Length: number of bits that constitute the network ID.
- 22IP addressesPublic IP addresses are valid destination on Internet – mostly exhausted
Private IP addresses can be used within private networks like home or a small company ie each network device inside your network will have private IP. Reserved prefixes for private address are:10.0.0.0/8 or 172.16.0.0/12 or 192.168.0.0/16. To communicate with Internet, NAT (Network Address Translation) box maps these private IP addresses to one public IP address. - 23IPv6 formatheader is simpler than IPv4. Source/destination addresses are 16 bytes each. Addresses with first 12 bytes as 0 are interpreted as IPv4 addresses so can coexist with v4. An IPv6 address is represented as 8 groups of 4 hexadecimal digits each group represented 16 bits. Groups separated by colons.
- 24ICMP Internet Control Message Protoclused by network devices including routers to send error messages and operational information (ie destination unreachable, time exceeded). Also used for router advertisement/solicitation to find a nearby router.
- 25ARP Address Resolution Protcolused to convert IP address into Ethernet address. ARP broadcasts request to all machines on LAN and asks if any are using that particular IP address. When machine recognized IP address as own, send a reply with its MAC address. Depending on where destination is ARP can be done by host itself (if destination is same LAN) or router (destination is in another LAN)
- 26DHCP Dynamic HOst Configuration Protocolassigns local IP addresses to host dynamically. When new host set up, its DHCP client program broadcasts a DHCP discover packet. DHCP relay on local LAN forwards discover packet to a (possibly remote) DHCP server. DHCP server replies with an IP address for host.
- 27Routing algorithms Routing has 2 distinct phases:: responsible for deciding which output line an incoming packet should be transmitted on. Routing has 2 distinct phases:
1. Routing algorithm: Routers exchange information to decide best routes and store routes in tables
2. Forwarding: Routers forward packets according to what tables say - 28Routing alorithms mst pick bets amoung them depends on? 4Most hosts have many outbound lines, so routing algorithm must pick bets among them. This depend on: topology, speed of interconnections, apparent load of target host, congestion.
- 29Routing algorithms can be classeified as? 2- Adaptive algorithms; attempt to change routing decisions to adjust to traffic changes or topology changes. Measurements are made of the network traffic during network operation and changes are made to algorithm if necessary. Dynamic
- Non-adaptive algorithms: don not adjust to traffic or topology changes. Some strategy worked out beforehand and not changed during network operation. Static - 30Flooding In order to stop floodk 2 ways?source sends a packet to every one of its neighbors, each of which sends packet on to every one of its neighbors (except the source)… Eventually destination will receive at least 1 copy of packet. In order to stop flood 2 ways: 1. node must remember every packet it has seen so if it receives another copy it will not pass it on again. 2. Implement a hop counter in the packet header which is decremented at each hop. When reaches 0, throw it out (otherwise could wander network forever). Flooding is not practical in most applications. Robust when large numbers of routers may be destroyed at any instant (military applications) because every possible route will be tried, shortest path found.
- 31LSR (link State Routing): each router must do 5 steps to know topology of network: go through the 5 steps:1. Discover neighbors, learn their network address.
2. Measure cost to each of its neighbors. Cost could be: number of hops, geographical distance in km, mean queuing delay, transmission delay for some standard test packet (eg LSR) or combination of any. (packet sent, packet echoed) – measure delay on the echo (round trip time / 2)
3. Construct a packet telling all it has just learned
4. Distribute this packet to all other routers: Uses flooding to distribute link state packets. Now each route knows complete topology (can build graph of subnet with each node on graph representing a router and each arc of graph representing communication line. Each arc is labelled with cost)
5. Compute best path to every other router based on information in link state packets by use of a static algorithm. Ie Dijkstra’s algorithm – finding shortest path between them on graph. - 32Dijkstra’s algorithm to computer the shortest pathinitially, no paths known, so all nodes labelled with infinity (tentative). As progresses and paths found, labels may change reflecting best paths. Labels either tentative or permanent. Initially all labels are tentative. When discovered label represents shortest possible path from source to node make permanent and never changed after. Eventually each node will be labelled with distance from source node along best known path. Router A becomes start router – mark as permanent.
start of loop
for each of the start router’s tentative neighbors:
calculate neighbor’s distance from A via start router by adding distance between neighbor and start router to distance contained in lable on start router. If new calculated distance from A is less than on neighbors existing label, relable neighbor with distance from A and name of start rounter. Examine all tentative labels, choose minimum from A and make router new start.
Repeat loop until all routers are labelled permanent. Trace shortest path by following labels from destination to source.
GO OVER PRactice examples - 33Congestion control can be brought by several factors: 2 (second factor has 3 points)when too many packets are present in the subnet, performance degrades. This situation is called congestion.
- Hardware problem: slow processors
- Network topology:
o Streams of packets begin arriving on 3 or 4 input lines and all need same output line, queue will build up
o Insufficient memory, packets will be discarded – sending router times out and retransmits until packets get through
o By time packets get in front of queue, have already time out (repeatedly) and duplicates have been sent causing more congestion – congestion collapse - 34congestion controlwhen number of packets hosts send into network is well within carrying capacity, number delivered is proportional to number sent. When too much traffic is offered, congestion sets in and performance degrades sharply.
- 35Network Provisioningbuild network well matched to traffic that it carries. Turn on space resources as needed.
- 36Traffic-Aware RoutingComputer routes: take traffic into account not just topology. Shift traffic away from congestion hotspots by changing shortest path weights. Splitting traffic across multiple path.
- 37Admission Congrol (Traffic shaping)Allows new traffic load only if network has sufficient capacity. One of main causes of congestion is that traffic is often bursty. If hosts could be made to transmit at a uniform rate, congestion would be less common: traffic shaping. Traffic shaping regulates average rate and burstiness of data transmission. 2 approaches: leaky bucket algorithm. Token bucket algorithm.
- 38Leaky Bucket Algorithmturns an uneven flow of packets from host into an even flow of packets onto the network, smoothing out bursts and greatly reducing changes of congestion. Enforces a rigid output pattern at average rate no matter how bursty the traffic is. For many applications, better to allow output to speed up somewhat when large bursts arrive so more flexible algorithm is needed.
- 39Token bucket algorithmallows output rate of vary depending on size of burst. Bucket holds tokens, generated by a clock at a constant rate. For packet to be transmitted, must capture and destroy one token. Allow idle hosts to save up permission to max size of the bucket, N. Means bursts of up to N packets can be sent at once, allowing some burstiness in the output stream and giving further response to sudden bursts of input. Potential problem is that it allows large bursts again. One way to get smoother traffic is to put a leaky bucket after token bucket.
- 40Traffic throttling: Choke Packets. sender on receiving choke packet will reduce transmission rate sent to specified destination by a certain percentage 2 apporaches possible:Choke Packets: another way to handle congestion. Consists in: waiting for network to approach congestion; Congested router tell senders to slow down by sending choke packets along reverse routes which are generating most traffic; sender on receiving choke packet will reduce transmission rate sent to specified destination by a certain percentage. 2 approaches possible:
- Choke packet affects only source. Intermediate routers ignore packet. Source throttles-back.
- Choke packet that affects each hop it passes through. Intermediate routers throttle-back too - 41Load sheddingif congestion continues (and all other methods fail) routers can start dropping packets. Simulation show that when a router senses trouble on horizon, better to discard packets early rather than wait until becomes completely clogged up. Router overloaded with packets can just pick packets at random to drop but usually random is not best way.
- 42load shadding: which pakcet to discard shold depend on applications running 2 appproaches and what they mean- Wine approach: old packet worth more than new so only newest packets should be dropped. Used for applications that require reliability, especially with sliding window protocols
- Milk approach: new packet more important than old one (eg multimedia application
Information
- Description
- Uni Uni Second Level (Software Systems) Flashcards on The Network Layer (5), created by HRYN red on 15/12/2024.
- Created by
- HRYN red
- Views
- 4
- Rating