[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
Q

What is Layer 4 of the OSI model?

A

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

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

What is Layer 3 of the OSI model?

A

Network e.g. IP

Looks for the best path to reach the destination

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

What is Layer 2 of the OSI model?

A

Data Link e.g. MAC addresses

This layer is used for directly connected devices

Communication between adjacent nodes

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

What is Layer 1 of the OSI model?

A

Physical

Handles bit level communication between nodes

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

At which OSI layer is HTTP?

A

Layer 7: Application

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

At which OSI layer is compression?

A

Layer 6: Presentation

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

At which OSI layer is encryption?

A

Layer 6: Presentation

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

At which OSI layer is TCP?

A

Layer 4: Transport

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

At which OSI layer is UDP?

A

Layer 4: Transport

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

At which OSI layer is IP?

A

Layer 3: Network

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

At which OSI layer is packets?

A

Layer 3: Network

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

At which OSI layer are MAC addresses?

A

Layer 2: Data Link

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

What are the layers of TCP/IP Model?

A

[4] Application
[3] Transport
[2] Internet
[1] Network Access / Link

38
Q

At which TCP/IP layer does routing occur?

A

Layer 2: Internet

39
Q

At which TCP/IP layer is TCP/UDP?

A

Layer 3: Transport

40
Q

What are the types of network transmissions?

A

Unicast, Broadcast and Multicasts

41
Q

What type of transmission is TCP used for?

A

Unicast

42
Q

What type of transmission is UDP used for?

A

Multicast

43
Q

How do network devices handle broadcast messages?

A

Switches are designed to forward them while routers drop them

44
Q

What address is used for broadcasts?

A

255.255.255.255

45
Q

Does IPv6 support broadcast?

A

No.

It has an ARP alternative that uses multicast

46
Q

How do network devices handle multicast messages?

A

Data can be replicated both by routers and switches i.e. the data can leave a network

47
Q

What controls which devices receive multicast messages?

A

Membership in multicast groups

48
Q

What is the default route?

A

0.0.0.0 is the default route that is used if no other route is available for the intended destination

49
Q

What are stub routes?

A

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
Q

What are the basic ways of configuring routing?

A

Static Routing & Dynamic Routing

51
Q

What is static routing?

A

The routes are manually configured. This is used in small networks. It lacks fault tolerance but improves performance & security

52
Q

What is dynamic routing?

A

Routes are configured automatically to find the best route for traffic

53
Q

What are the basic types of dynamic routing? What are they used for?

A

Interior Gateway Protocol (IGP) is used within a network

Exterior Gateway Protocol (EGP) is used for routing between networks

54
Q

How does IGP work?

A

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
Q

What is the main type of EGP?

A

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
Q

How does BGP work?

A
  • 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
Q

In Linux, where are routing tables stored?

A

/etc/iproute2/rt_tables

58
Q

What is a key route in the routing table?

A

The loopback route which is used by localhost

59
Q

What is the route selection criteria used when interpreting routing tables?

A

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
Q

What Linux command shows the current IP?

A

ip addr shows the IP for each attached network interface. This replaces ifconfig

61
Q

Which Linux command shows the ARP table?

A

ip neigh. Replaces the arp command

62
Q

Which Linux command shows the routing table?

A

ip route

63
Q

Which Linux command shows the path that packets take when travelling to a specific destination?

A

traceroute

64
Q

What port does ping use?

A

None - it is ICMP which is at a lower level

65
Q

What is ICMP?

A

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
Q

What protocol does ping use?

A

It is part of ICMP, specifically it is an ICMP echo request!

67
Q

What protocol/layer is BGP?

A

It is a Layer 4 protocol that uses TCP

68
Q

How does BGP work?

A

It doesn’t perform discovery - peers must be manually configured.

Networks are identified based on their ASN (Autonomous System Number) identifier

69
Q

What command is used to view the ARP table?

A

ip n (short for “neighbour”)

70
Q

What OSI Level is ARP?

A

Level 2

71
Q

How does ARP work if the destination is outside the local network?

A

ARP proxy means that the router will respond with its MAC address if it knows a route to that location

72
Q

What OSI Level is DNS?

A

Level 7

73
Q

What command is used to lookup DNS records?

A

dig e.g. dig -4 amazon.com to look up the A record (IPv4) for amazon.com

74
Q

What is a FQDN?

A

A fully-qualified domain i.e. the complete domain name for a specific host on a network

75
Q

What is the DNS resolution process

A

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
Q

What protocol does DNS resolution use?

A

UDP

77
Q

What layer is TCP?

A

Later 4: Transport

78
Q

What are the data units for TCP?

A

Segments; each has a checksum for verification

79
Q

What happens if a TCP checksum doesn’t match the content?

A

The receiver simply discards it and waits for the segment to be resent

80
Q

What are the TCP handshake steps?

A

[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
Q

What command is used to view active network connections?

A

netstat

82
Q

What are the key firewalls used in Linux?

A

iptables and firewalld, both of which implement the netfilter API within the Linux kernel

83
Q

What port does DNS use?

A

Port 53, hence why it’s called “Route53”

84
Q

How can connection to a port of a remote host be verified?

A

[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
Q

What is port forwarding?

A

Based on which port you use to connect to a public IP, you are forwarded to a particular private host

86
Q

What is a proxy server? What is it used for?

A

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
Q

What is the purpose of load balancing?

A
  • redundancy / high availability
  • horizontal scaling
  • hybrid cloud
88
Q

What are the modes of load balancing?

A
  • Round Robin - nodes take turns
  • Least Connections - send to node with least active connections
  • IP Hash - sticky connections for stateful applications
89
Q

What is a common load balancer?

A

NGINX can function as a caching webserver and load balancer

90
Q

What is IDS/IPS?

A
  • IPS = Intrusion Prevention System

* IDS = Intrusion Detection System

91
Q

What is the high-level purpose of the TLS handshake?

A

To establish a shared secret so traffic can be encrypted