[1] Networking Flashcards

1
Q

What does “IP” cover

A
  • the format for each data unit (“packet”)
  • the addressing for hosts on a network
  • mechanisms for routing packets between hosts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the format of an IP address?

A

IPv4 is 32 bit (consists of four octets)

IPv6 is 128 bit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some key components of an IP packet?

A

The header, which includes the Protocol (TCP or UDP), the Time to Live (number of hops left), Source Address and Destination Address

The Data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does IP prevent infinite loops?

A

Each packet has a TTL which counts down with each hop

When the TTL reaches 0, the packet is discarded

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two ways of specifying a network in IP?

A
  • Classful IP Addressing. Class A has few networks but each has many hosts
  • CIDR (Classful Inter-Domain Routing)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What IP Class is reserved for multicast adresses

A

Class D.

Class E exists but is reserved for future use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does CIDR notation work?

A

The number after the slash is the size of the subnet mask e.g. for 198.51.100.14/24, the first 24 bits specify the subnet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is VLSM?

A

Variable Length Subnet Masking (VLSM) allows multiple different subnet masks to be implemented in order to further break up a subnet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is ARP?

A

Address Resolution Protocol (ARP) is used to find the MAC address of a device from its IP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the process for ARP?

A
  • A host broadcasts an ARP Request on 255.255.255.255 to all devices on that network
  • Any matching devices then unicast their MAC address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is proxy ARP?

A

When one device responds to ARP requests on behalf of another that isn’t on that network

For example, the router might respond that it has a route to a neighbouring subnet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Is ARP cached?

A

Yes. The ARP cache is a table of entries that stores the previous IP, MAC address and Network Interface (e.g. “eth0”) of previous ARP requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the key parts of an ARP packet?

A
  • Hardware type (e.g. ethernet)
  • Protocol type e.g. IPv4
  • IP & MAC addresses of the source and target
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is NAT?

A

Network Address Translation maps one IP address to another by modifying the IP header of network packets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the primary purpose of NAT?

A

It maps a single public (routable) IP address to one or more private (unroutable) IP addresses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the types of NAT?

A
  • Static NAT
  • Dynamic NAT
  • Port Address Translation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How does Static NAT work?

A

It is a 1-to-1 mapping e.g. the same host is always mapped to the same IP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How does Dynamic NAT work?

A

The NAT device is assigned a pool of IP addresses which are shared between the hosts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How does Port Address Translation Work?

A

The NAT uses one public IP address but allows connections on multiple ports. Each port is mapped to a different host

The source address packet is modified so the target knows how to respond

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How is NAT different based on connection source?

A
  • Source NAT is used for hosts on private networks that want to initiate outbound connections; the source address is modified
  • Destination NAT allows devices outside the private network to connect in; it modifies the destination address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What are the layers of the OSI model?

A
[7] Application
[6] Presentation
[5] Session
[4] Transport
[3] Network
[2] Data Link
[1] Physical
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is Layer 7 of the OSI model?

A

Application e.g. SMTP / FTP / HTTP

It is the interface permitting the user to send and receive data through clients and applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is Layer 6 of the OSI model?

A

Presentation e.g. compression and encryption

It converts the requests to a form that the application can use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is Layer 5 of the OSI model?

A

Session

It open, closes and manages session between the process and response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is Layer 4 of the OSI model?
Transport i.e. how data is broken down into packets e.g. TCP / UDP Defines how data will be sent (i.e. as packets) between the process and the response. It provides data validation and security
26
What is Layer 3 of the OSI model?
Network e.g. IP Looks for the best path to reach the destination
27
What is Layer 2 of the OSI model?
Data Link e.g. MAC addresses This layer is used for directly connected devices Communication between adjacent nodes
28
What is Layer 1 of the OSI model?
Physical Handles bit level communication between nodes
29
At which OSI layer is HTTP?
Layer 7: Application
30
At which OSI layer is compression?
Layer 6: Presentation
31
At which OSI layer is encryption?
Layer 6: Presentation
32
At which OSI layer is TCP?
Layer 4: Transport
33
At which OSI layer is UDP?
Layer 4: Transport
34
At which OSI layer is IP?
Layer 3: Network
35
At which OSI layer is packets?
Layer 3: Network
36
At which OSI layer are MAC addresses?
Layer 2: Data Link
37
What are the layers of TCP/IP Model?
[4] Application [3] Transport [2] Internet [1] Network Access / Link
38
At which TCP/IP layer does routing occur?
Layer 2: Internet
39
At which TCP/IP layer is TCP/UDP?
Layer 3: Transport
40
What are the types of network transmissions?
Unicast, Broadcast and Multicasts
41
What type of transmission is TCP used for?
Unicast
42
What type of transmission is UDP used for?
Multicast
43
How do network devices handle broadcast messages?
Switches are designed to forward them while routers drop them
44
What address is used for broadcasts?
255.255.255.255
45
Does IPv6 support broadcast?
No. | It has an ARP alternative that uses multicast
46
How do network devices handle multicast messages?
Data can be replicated both by routers and switches i.e. the data can leave a network
47
What controls which devices receive multicast messages?
Membership in multicast groups
48
What is the default route?
0.0.0.0 is the default route that is used if no other route is available for the intended destination
49
What are stub routes?
A network which is unaware of other networks and which all non-local traffic is routed through a single default path Basically, it's a home network!
50
What are the basic ways of configuring routing?
Static Routing & Dynamic Routing
51
What is static routing?
The routes are manually configured. This is used in small networks. It lacks fault tolerance but improves performance & security
52
What is dynamic routing?
Routes are configured automatically to find the best route for traffic
53
What are the basic types of dynamic routing? What are they used for?
Interior Gateway Protocol (IGP) is used within a network Exterior Gateway Protocol (EGP) is used for routing between networks
54
How does IGP work?
Either: * Distance-Vector Routing Protocols optimise for a distance metric e.g. hops or latency * Link-State Routing Protocols involve each router storing the entire network topology
55
What is the main type of EGP?
Border Gateway Protocol (BGP), which is a type of Path-Vector Routing Protocol i.e. the routing table caches the destination network, next router, and path to reach that destination
56
How does BGP work?
* Uses TCP on Port 179 * Routes are stored on the Routing Information Base (RIB) * Routes are manually configured between peers * Optimises for number of hops
57
In Linux, where are routing tables stored?
/etc/iproute2/rt_tables
58
What is a key route in the routing table?
The loopback route which is used by localhost
59
What is the route selection criteria used when interpreting routing tables?
The following criteria (including tie breakers) [#1] Prefix Length - use the most specific match [#2] Administrative Distance - arbitrary weights are assigned to routing protocols [#3] Metric Value - optimises for hops etc. based on the routing protocol
60
What Linux command shows the current IP?
ip addr shows the IP for each attached network interface. This replaces ifconfig
61
Which Linux command shows the ARP table?
ip neigh. Replaces the arp command
62
Which Linux command shows the routing table?
ip route
63
Which Linux command shows the path that packets take when travelling to a specific destination?
traceroute
64
What port does ping use?
None - it is ICMP which is at a lower level
65
What is ICMP?
Internet Control Message Protocol (ICMP) is an error-reporting protocol that is used to send control messages to the source of a data packet when there are delivery issues
66
What protocol does ping use?
It is part of ICMP, specifically it is an ICMP echo request!
67
What protocol/layer is BGP?
It is a Layer 4 protocol that uses TCP
68
How does BGP work?
It doesn't perform discovery - peers must be manually configured. Networks are identified based on their ASN (Autonomous System Number) identifier
69
What command is used to view the ARP table?
ip n (short for "neighbour")
70
What OSI Level is ARP?
Level 2
71
How does ARP work if the destination is outside the local network?
ARP proxy means that the router will respond with its MAC address if it knows a route to that location
72
What OSI Level is DNS?
Level 7
73
What command is used to lookup DNS records?
dig e.g. dig -4 amazon.com to look up the A record (IPv4) for amazon.com
74
What is a FQDN?
A fully-qualified domain i.e. the complete domain name for a specific host on a network
75
What is the DNS resolution process
It works in reverse order: [1] the implied '.' is resolved by the root servers [2] the TLD is resolved by the TLD servers [3] the query is then forwarded to the name servers of the domain [4] the name servers answer the request or forward to additional authoritative DNS hosts managing the zones within the domain
76
What protocol does DNS resolution use?
UDP
77
What layer is TCP?
Later 4: Transport
78
What are the data units for TCP?
Segments; each has a checksum for verification
79
What happens if a TCP checksum doesn't match the content?
The receiver simply discards it and waits for the segment to be resent
80
What are the TCP handshake steps?
[1] Host A unicasts a SYN request to Host B [2] Host B returns a SYNACK message [3] Host A sends [ACK, DATA] to Host B
81
What command is used to view active network connections?
netstat
82
What are the key firewalls used in Linux?
iptables and firewalld, both of which implement the netfilter API within the Linux kernel
83
What port does DNS use?
Port 53, hence why it's called "Route53"
84
How can connection to a port of a remote host be verified?
[1] on the sender, use telnet [ip] [port] to send packets to the remote host [2] on the remote host, use netcat to listen to that port and see if the connection is made
85
What is port forwarding?
Based on which port you use to connect to a public IP, you are forwarded to a particular private host
86
What is a proxy server? What is it used for?
It makes network requests on behalf of the the host connected to it It's used to access private resources, to implement caching, and for web filtering
87
What is the purpose of load balancing?
* redundancy / high availability * horizontal scaling * hybrid cloud
88
What are the modes of load balancing?
* Round Robin - nodes take turns * Least Connections - send to node with least active connections * IP Hash - sticky connections for stateful applications
89
What is a common load balancer?
NGINX can function as a caching webserver and load balancer
90
What is IDS/IPS?
* IPS = Intrusion Prevention System | * IDS = Intrusion Detection System
91
What is the high-level purpose of the TLS handshake?
To establish a shared secret so traffic can be encrypted