Download IP Addressing and Routing Protocols and more Exams Nursing in PDF only on Docsity!
COMPUTER SKILLS 463 EXAM 2
QUESTIONS WITH ANSWERS 2024 LATEST
UPDATED AND GRADED A+
(review) name the five layers in order (top-down) - Solution application layer transport layer network layer data link layer physical layer Layer n interfaces only with layer (n-1) and (n+1). lower layer served immediate upper layer Known as OSI (open systems interconnection) model (layering principle) what is the purpose of L5? - Solution Application: Network service to users or apps read/write data from apps, encrypt/decrypt (layering principle) what is the purpose of L4? - Solution Transport: Reliable end-to-end data delivery reliability, app multiplexing (layering principle) what is the purpose of L3? - Solution Network: Best- effort data delivery between networks naming, addressing, dest. discovery, routing, forwarding (layering principle) what is the purpose of L2? - Solution Data Link: best- effort data delivery within a local network naming, addressing, dest. discovery, routing, forwarding (layering principle) what is the purpose of L1? - Solution Physical: bits to and from wire
signal processing, A2D conversions What does network layer do? - Solution Connects different networks
- global standard protocol to connect different local networks
- data link layer used to deliver data within each local area network (LAN)
- LANs can run its own network protocol communication within LAN (ethernet, wifi, 5G) Describe the most popular protocol for the data link layer - Solution Switched ethernet -Addressing: MAC address -Forwarding: MAC forwarding -Routing: MAC learning + STP -Dest. Discovery: ARP Describe the most popular protocol for network layer - Solution Internet protocol (IP)
- Addressing: IP address
- Forwarding: IP forwarding
- Routing: Network routing protocols (DV, LS, BGP)
- Dest. discovery: DNS Why do we need different solutions for the same problem when solving that problem on the data link layer versus network layer? - Solution - These layers work at a different scale: local data delivery vs. global data delivery
- MAC wouldn't solve the problem on the network layer Describe MAC vs. IP address - Solution - MAC shows identity of the host
- IP shows location of the host
- MAC will not change (used for host-based services)
- IP changes as host moves from one network to another (or even re-joins same network) (used for location-based services) Why do we need IP forwarding instead of MAC forwarding when on the network layer? - Solution MAC addresses are flat
- does not scale for large networks
DNS (centralized)
- requires dedicated infrastructure
- requires extra mechanisms for fault tolerance
- requires no broadcasts
- pros outweigh cons for large networks like internet What is an IP address (IPv4) - Solution - Identifies location of host
- 32 bits as X.X.X.X where X is 8-bit decimal
- dotted decimal format There are 32 bits in an IPv4 address. Describe what those bits represent as an analogy (this is versatile, the number of bits per section can change) - Solution From MSB - LSB: (subnet address prefix) 6 rep country 12 rep state 7 rep city (host identifier) 7 rep street # What is a subnet mask? - Solution - Used to extract subnet address from IP address
- 32 bits: 20 1s followed by 12 0s
- Subnet address = IP address (bitwise AND) subnet mask Describe classful addressing - Solution IP addresses divided into set of classes
- Each class has n bits statically allocated for subnet address, and 32-n bits for host identifier What are the 3 classes of classful IP addressing? - Solution Class A: n = 8 Class B: n = 16 Class C: n = 24 For class A, answer the following:
MSBs
subnet bits
host bits
subnets
hosts
smallest addy highest addy - Solution 0 MSBs 8 subnet bits 24 host bits 2^7 subnets = 128 2^24 hosts 0.0.0. 127.255.255.255. For class B, answer the following:
MSBs
subnet bits
host bits
subnets
hosts
smallest addy highest addy - Solution 10 MSBs 16 subnet bits 16 host bits 2^14 = 16k subnets 2^16 hosts 128.0.0. 191.255.255. For class C, answer the following:
MSBs
subnet bits
host bits
subnets
hosts
smallest addy highest addy - Solution 110 MSBs 24 subnet bits 8 host bits 2^21 = 2M subnets
For Internet Protocol, how do we address the following: Addressing Forwarding Routing Destination Discovery - Solution -IP Address -IP Forwarding -Network routing protocols (DV, LS, BGP) -DNS True or false: All hosts within a subnet share the same Subnet Address Prefix - Solution True CIDR is more flexible. How does that correspond to complexity at routers? - Solution CIDR is more complex at routers What is the key to encode the network hierarchy? - Solution Child subnet/host address includes the subnet bits of its parents address as its prefix - to encode the network hierarchy What are the two options for configuring IP address of a host? - Solution 1. Manual(static) configuration (problematic)
- Dynamic Host Configuration Protocol (DHCP) (better) Describe manual(static) configuration - Solution - On linux one would run command: ifconfig netmastk
- problematic bc (1) you must ensure prefix matches the network the host is part of and (2) ensure IP address doesn't class with other machines on the same network Describe DHCP - Solution Dynamic Host Configuration Protocol
- enabled by default on modern OS
- maintains pool of allowed IP addresses for a network
- assigns machine a new unused IP from the pool at start up
- each assigned IP is associated with a lease, and if not renewed before expiration, the IP can be re-assigned to a different machine
What is the main issue with Public IPv4 addresses? - Solution - hosts over Internet have to have unique IP for unique routing
- Can only have 2^32 ~ 4B unique IPv4 addresses
- there is an exhaustion problem What is the solution to the IPv4 exhaustion problem? - Solution Private IP addresses
- Cannot be used for routing over Internet Describe private IP addresses - Solution Assigned to hosts within a private network
- Can be used for comms only within private network
- packets with private IP addresses are dropped by public Internet routers
- 2 hosts in different private networks can have same private IP address What are the reserved private IP address ranges? - Solution 10.0.0.0/ (10.0.0.0 - 10.255.255.255) 172.16.0.0/ (172.16.0.0 - 172.31.255.255) 192.168.0.0/ (192.168.0.0 - 192.168.255.255) How can hosts with private IP addresses communicate over the internet? - Solution NAT Network address translation What is NAT? - Solution Network Address Translation
- enables hosts on private networks to communicate with hosts on Internet
- NAT device sits at boundary of private network and public Internet (usually inside gateway router) How does NAT work? - Solution - managers pool of public IP addresses allocated to private network
- When host from private network wants to send IP packet to public host, NAT picks a public IP from the pool and re-writes the source IP (private) in the packet with public IP
- Stores private IP -> public IP mapping in a table to retranslate destination (public) IP of an incoming reply packet with corresponding private IP
- IP address in application data - Solution apps that carry IP address in payload of the application data (like http) do not work across private-public network boundaries
- NAT is layer 3 device - cannot do translations inside application layer headers How many bytes in an IPv4 header? - Solution 20 bytes + options What fields of an IPv4 header are for reading packet correctly? - Solution
- 4-bit Version -"4" for IPv
- 4-bit Header Length -# of 32-bit words in header -Usually "5" for 20B header -Can be more if options r used
- 16-bit Total Length (B)
- size of IP packet = IP header + Payload
- max size = 2^16 - 1 = 65,535 B What fields of an IPv4 header are for getting packet to destination and back? - Solution 1. 32-bit source IP address
- 32 bit dest. IP addres What fields of an IPv4 header are for transport layer protocol type? - Solution 1. 8-bit Protocol What fields of an IPv4 header are for special handling of packet? - Solution 1. 8-bit Type of Service (TOS)
- routers read this field to device how to treat packets
- ex: routers may allow some packets to jump queue for low delay if this field is set
- options (if any)
- specify custom header fields What fields of an IPv4 header are for handling potential problems? - Solution 1. 16-bit identification
- 3-bit Flags
- 13-bit Fragment offset
- 8-bit Time to live (TTL)
- helps reduce number of times packet circulates in a loop
- usually set to some high value and decremented at each hop, packet gets dropped if set to 0
- 16-bit Header checksum
- checksum over entire IP header to detect and recover from bit corruption or bit flips on the wire What is fragmentation in IP header field? - Solution 32 bits - 16 bit ID + 3 bit Flags + 13 bit Offset
- max size of 65,536 (total length field) but data link layer might impose smaller packet sizes. in this case, IP packets need to be fragmented and reassembled at destination network layer Why does IP Fragmentation occur? - Solution Data link layer may impose smaller packet size, so the IP packets get fragmented and sent in smaller packets, then reassembled at the destination network layer Hierarchical addressing allows _ _, hence ____ - Solution Hierarchical addressing allows address aggregation, hence less table entries Compare MAC forwarding vs. IP forwarding - Solution - MAC forwarding involves the forwarding table storing the address of each host
- IP involves routing table storing address of subnets, reducing the number of table entries but increasing complexity of forwarding Why can IP forwarding routing tables lead to packets matching multiple table entries? - Solution - a host can belong to multiple subnets due to hierarchical structure
- routing tables store subnet addys
- if routing table has entries dor multiple subnets that the dest. host belongs to, then destination IP field will match against all of those entries -- choose the most specific subnet
Describe distribute path computation - Solution Similar to STP - each router computes paths using a distributed algorithm, oblivious to network topology Ex: distance vector or border gateway Describe distributed topology computation - Solution Routers use distributed algorithm to learn the entire network topology Each router runs a local path computation algorithm on network topology Ex: link state Describe the DV algorithm - Solution Distance Vector
- Calculates best path from each router to all "n" routers
- RIP is most popular implementation
- Each router maintains a vector of views of its best path to all other routers and hosts
- Shares its vector with all neighbor routers
- Updates vector on receiving vectors from neighbors What is the most popular implementation of DV? - Solution Routing Information Protocol (RIP) How are vectors initialized when using DV? - Solution (X, 0, X) (dst, cost to dst, next hop to dst) Describe the 3 parts of DV:
- Initialize
- Update
- Advertise - Solution 1. Initialize: X initialized routing table and adds (x,0,x) and corresponding to each neighbor Y adds (y, cost(x,y),y) then advertises routing table vector to neighbors
- Updates routing table after receiving routing table from Y
- If routing table changes, advertise to neighbors immediately. periodically advertise as well
Why does DV involve periodic advertisements? - Solution Periodic advertisements are required so each node can eventually find a path If not, a link might fail and the neighboring routing table wouldn't know if it doesn't change its vector Does DV always avoid loops? - Solution NO
- if router X ends up choosing a path that contained X, we have a loop/count-to-infinity
- count to infinity can happen in DV when routers/links fail or cost of link changes What is Split Horizon? - Solution - similar to case 0 in STP
- if advertised path has next hop as you, ignore it!
- can prevent loops involving 2 routers, but not loops involve 3+ routers
- loops in DV What is the fundamental limitation of DV? - Solution Advertisement in DV do NOT contain the entire path to destination, only the next hop to the destination
- this means networks of size 3+ are difficult to avoid loops in bc X cannot see path beyond its next hop What is Max Infinity Counter? - Solution - Method of detecting and removing loops
- Set infinity to some large counter value (larger than path cost in network)
- when cost to a destination reaches or exceeds infinity, router detects a count-to-infinity problem
- the router removes the destination entry from its routing table (or sets next hop for entry as NULL) this removes loops from graph Is Max Infinity Counter a substitute for Split Horizon? - Solution NO
- used alongside Split Horizon
- split horizon proactively prevents loops, Max Infinity Counter reactively removes loops
-- it is difficult to avoid out of order delivery (depends on network dynamics, queuing, # of hops, etc)
- this wasn't an issue w STP or DV bc control messages were only exchanged w direct neighbors / 1 hop How do we detect and mitigate out of order LSA? - Solution - each router maintains a local sequence number -- router includes local sequence number in the LSA upon generation and increments it by 1
- each router also has list of highest sequence number that it received from other routers --helps avoid broadcast storm of LSAs
- if highest sequence number received from Y at X is S, and X receives LSA w sequence # <= S, it ignores it and does not floor Can loops form in LS? - Solution Yes - loops can be formed
- loops in LS are transient and are eventually removed How do we manage transient loops in LS? - Solution Time to Live (TTL) field in IP packet
- IP packets carry 8-bit TTL field
- TTL is decremented at each hop
- When TTL reaches 0, packet is dropped by router TTL is complementary of routing protocol, not substitute How does split horizon help avoid count-to-infinity? - Solution Under split horizon, router X will ignore router advertisement to d from Y with next hop as X This prevents start of count to infinity Can split horizon always avoid cycles involving 3+ routers? - Solution No In general, split horizon cannot avoid cycles involving 3+ routers Possible solutions:
- set low cutoff value for infinity which is larger than any cost in graph
- this solution detects and mitigates count to infinity
- advertise entire path instead of next hop like in BGP. avoids count to infinity
- use program like Link State to create entire graph at each router and run local computation algorithm. this would avoid What is an AS? - Solution Autonomous System / Domain
- network under a single administrative domain (AT&T, Purdue, IBM)
- sometimes called "domains"
- each AS is assigned a unique identifier (16 bit number) What are the types of routing classes for ASes? - Solution Intra-domain routing
- routing with an AS
- RIP (DV) or OSPF (link state) Inter-domain routing
- Routing between ASes
- Border Gateway protocol (BGP) What are the 3 goals of inter-domain routing? - Solution 1. ASes want freedom to pick routes based on custom policy
- ASes want autonomy (choose their own internal routing protocol, their own policy)(DV/LS requires agreement on metric)
- ASes want privacy (don't want other ASes to know their internal topology, choice of policies)(LS requires each node to know entire network graph) Describe business implications in inter-domain routing - Solution - customer pays provider
- perrds do not pay eachother and exchange roughly equal traffic Why is peering needed? - Solution Needed to connect provider ASes at the top of the Internet hierarchy (ones that have no providers)
- these r called Tier 1 ASes peering can be done at lower tiers to save money
through peer = make money)(path through peer > path through provider = save money)(Gao-Rexford path selection policy)
- maximize performance (shortest path)
- minimize use of network bandwidth (hot potato routing/handover traffic asap)(shortest path to egree gateway router) What is Gao-Rexford advertisement policy? - Solution Avoid being transit when no monetary gain
- AS provides transit to customers only. not providers or peers Who runs BGP? - Solution Gateway/border routers What is eBGP and iBGP and IGP? - Solution External BGP: used to learn external routes (between DIFFERENT ASes) Internal BGP: used to distribute externally learned routes internally (within SAME AS) Interior Gateway Protocol: intra-domain routing/used to provider internal connectivity (RIP, OSPF) Describe the 3 basic messages in BGP: - Solution 1. Open message
- establishes BGP connection
- BGP uses reliable transport layer (TCP)
- Update messages
- advertises new routes/route changes to neighbors
- update neighbors of old routers that become inactive
- Keepalive messages
- inform neighbor that BGP session is still active Outline a BGP update message - Solution Format: {Dest IP Prefix: Update type, Route attributes}
- Update type: Announcements or withdrawals (new routes/changes or removals)
- Route attributes: --ASPATH (vector of ASes that BGP has traversed)
--LOCAL PREF: preference value for ASPATH: higher = better -- IGP COST: cost to gateway router inside ASPATH from internal router (helps hot potato) Describe the issue with BGP: Reachability - Solution Even if a graph is connected, reachability is not guaranteed Ex: AS1 does not want to carry traffic between AS2 and AS3 even if AS connects them Describe the issue with BGP: Security - Solution - IP prefix hijacking --an AS can advertise an IP prefix that they don't have the route to -- results in blackhole (data is discarded), snooping(data is inspected), and redirection(data is redirected to bogus dests)
- difficult to debug bc it may not always cause loss of connectivity If BGP is so vulnerable, why do BGP attacks not happen more often? - Solution YOu need access to BGP routers to launch most BGP attacks. reduces # of potential hacks Describe the issue with BGP: Convergence - Solution - BGP converges when the best paths chosen by each AS do not change with further route ads
- For ASes following Gao-Rexford, convergence is guaranteed
- for arbitrary policies, BGP may fail to converge Is convergence always an issue with BGP? - Solution - Only with ASes not following Gao-Rexford:
- there will be unpredictable performance and latencies -> more processing at the BGP routers What is DNS? - Solution Domain Name System
- user has name of entity they want to address
- DNS provides mapping from name to IP address so user asks DNS for IP
- DNS is hierarchical