Networks 2 Flashcards

1
Q

What is true of checksums when it comes to UDP?

A

It isn’t compulsory in IPv4 but must be used in IPv6

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

What is UDP?

A

User Datagram Protocol. Fire + forget. Defined in RFC 768 to be minimal message oriented transport layer. Provides procedure for app programs to send messages to other programs with min of protocol mechanism, transaction oriented. Delivery + duplicate protection not guaranteed. Stateless, suitable for large nums of clients, good for unidirectional comms (stock market, streaming apps)

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

What should applications requiring ordered reliable delivery of data streams use?

A

Use TCP (transmission control protocol)

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

What does stateless mean?

A

Retains no state of UDP messages once sent.

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

Describe how UDP transmission works?

A

Data sent across network layer in finite packets. No error detection or correction, no connection oriented links, no verification of delivery links, basic datagram delivery. Easy to implement, minimal overhead + minimal header structure. Low intensity tasks performed in background (routine network monitoring)

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

Describe what’s in a datagram?

A

Contains header + payload. Header contains dest. (address + port), origin (address + port) + other info used for transmission. Payload contains data. Each one contains single message which may be request or reply.

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

Describe the source + dest port + message length field in UDP.

A

Source port field 16 bits long, assigned by originating host. Dest port field 16 bits long, usually well known port associated with app (DNS uses port 53). Message length field 16 bits, includes length in bytes of entire datagram.

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

What is port binding?

A

Ports generally well known, e.g. for services. When DNS server program executes on comp, tells comp it’s using port 53, known as binding a port. Port num is unsigned int + passed to function bind() which transfers to code for layer 4 of data comms stack. Client code doesn’t ask for port num. Well known port assignments are 0-1023, reserved so only programs run by root/admin user can use. Services also run as root/admin user but only 1024 of them.

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

How are ports assigned in UDP?

A

Client code sends data packet to server, layer 4 software chooses free port from ephemeral port range + puts value into source port of packet. Table links source port to client program. When server replies, takes received source port + makes dest. port for reply packets. Eph. ports allow each client session to run on unique port. Server always binds same port, client port changes. After client shut down, any port in use locked for short time before released back to free pool. OS can use any policy to allocate from eph. ports pool. Protocol + port together unique.

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

What do datagramSocket + datagramPacket do?

A
DS required to send/receive DP, all datagram sockets bound to local port. Listen for incoming data + place in datagram header of outgoing data.
Single class D IP addresses + port define 1 multicast channel. To mitigate UDP unreliability, data may be sent over 2 diff channels. Must be routed differently through network (geographically diverse routing) (A + B channels in industry)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the consequence of sending data over 2 diff channels in UDP?

A

Client may same message 2x (or not at all) Every message has unique num so client can detect if message same, gaps in message sequences + not receiving messages. Line arbitrage is algorithm to receive 1 instance of message (arbitrate between line A + B) Fall back TCP connection to get missed messages. Continuous rebroadcasting on sep set of UDP MC channels. Creating reliable comms responsibility is on app programmer (linehandler).

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

Why is UDP good even with its cons?

A

Faster than using TCP FSMs in ultra low latency environment. Full market data feed is multiple pairs of MC channels. Too many stocks to send in near real-time over 1 channel. 1 channel could have bit rate as low as 2 Mb/s.

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

What is a server?

A

Program that provides service + can be reached over network. Receives message from client, appr. processing carried out + response sent back to client. Docs stored as array of strings indexed 0 - 3. Client requests doc by sending index to it. It responds by sending it copy of doc.

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

What is a client?

A

Program that sends request to server for certain service + receives response from it. When it makes conn. to server, it must be running + waiting for its connection. Prompted to enter message to send to server + enter int 0 - 4. It waits for server to respond + contacts server until it quits.

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

What is TCP + describe in terms of client/server connection?

A

Connection-oriented service so conn. between source + dest established before transmission + ended when complete. To facilitate comm, hosts creates sockets + data transms. flow in streams between these. Server contains socket that listens at certain port for conn. requests. When request received, negotiates conn. + allocates socket to handle all comms between server + client which contains 1 socket where it initiates conn. to server + if conn. successful, uses to send data to from server.

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

How was TCP declared in RFCs?

A

IEEE published ‘A protocol for packet network intercommunication’ in May 1974. Central component was Transmission Control Program with connection oriented links + datagram services between hosts. TCP is complex protocol. Defined in RFC675, IPv4 in RFC793, num of TCP protocol implementation requirements clarified in RFC1122, congestion control in RFC2581 & RFC2009. Shares resources using packet switching among nodes.

17
Q

How does TCP work?

A

Programmer interacts with TCP via sockets, sep socket for each connection (1 to 1). Server + client operate diffly when setting up connection. Server bound to address + waits for connection. Client actively connects to server. TCP runs inside OS, complexity hidden from programmer. Exceptions thrown if connection drops.

18
Q

Why is TCP so good?

A

Maintains reliable connections between hosts + managed efficient packaging + transmission of network traffic. Virtual circuits (live, 2 way connections between hosts), reliable connections (guarantees data delivery) + performance optimisation (includes mechanisms to modify transmission variables depending on network conditions).

19
Q

Describe the FSM.

A

TCP uses finite state machine at end of connection. Implemented in OS software. 1 FSM - 1 TCP connection (socket) within OS so heavy workload. TCP exchanges events between 2 ends to drive state transitions. Events are bit flags which are set in TCP header.
Mathematical model of computation. Abstract machine, can be in 1 of finite num of states at a time. Can transition from 1 state to another due to ext inputs. Defined by list of states, initial state + conditions for transition. FSM at each side of connection.

20
Q

What are the TCP flag bits?

A

TCP flag bits between client & server: URG (set to 1 if urgent pointer in use), ACK (indicates acknowledgement num valid), PSH (data should be sent ASAP, pushed to app), RST (must reset connection), SYN (synchronisation occurring), FIN (finished).

21
Q

Describe opening three way handshake.

A

Host A sends TCP open request with SYN bit set + initial sequence num of 167, host B receives request + sends back frame with sequence num 498 + ACK num 168. Host A receives ACK frame + sends back with ACK num 499, Host B receives ACK frame + handshake complete. Guarantees connections established correctly. 3 messages exchanged, SYN segment describes connecting creating messages.

22
Q

Describe closing three way handshake.

A

FIN segment defines connection closing messages. Host A sends FIN, B receives it + sends FIN + ACK. B receives FIN + ACK + sends Ack, B receives ACK + connection closes.

23
Q

What are 2 good extras of TCP?

A

Flow control: TCP flags allow signalling between either end to control data flow rate (num of unacknowledged data bytes).
Window sizing: windowing process allows for either side to tell other how much data it can receive. Prevents buffer runs, achieved by event flags + sequence nums.

24
Q

What language do we use for TCP?

A

ASCII

25
Q

What is the deep web?

A

Part of internet not indexed by search engines. Still known IP address + usually domain name.

26
Q

What is the dark web?

A

Not indexed by search engines but sites don’t advertise IP addresses, access requires extra software + often operates using set of heavily encrypted layers run atop of internet. Includes illegal sites.

27
Q

What is onion routing?

A

Main tech used to enable dark web. Reg websites may be presented on onion network e.g. facebookcorewwwi.onion

28
Q

What is onion routing used for?

A

Protects comms from interception. TOR may be used, runs at app layer + lets you tunnel TCP through it. Hides source details by bouncing IP packets between source + dest around distributed network of relays run by volunteers around world