TCP/IP Flashcards

1
Q

What is a client program?

A

Running on end host
Does not communicate directly with other clients
Needs to know address of server

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

Can a client program communicate with other clients?

A

Not directly.

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

What is a server program?

A

Running on end host
Does not initiate contact with clients
Needs fixed, known address

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

How does the network layer deliver data?

A

Delivers data packet to destination host based on destination IP

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

How does the OS deliver data?

A

Delivers data to destination socket based on destination port number

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

How does the application layer deliver data?

A

Read data from and write data to socket (then interpret data - eg. read a webpage)

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

What is a socket?

A

Essentially a doorway leading in and out of an application. In order for a process to send a message to another, the underlying network must be traversed. This process sends and receives messages through the socket.

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

How does a process send a message to another process?

A

In order for a process to send a message to another, the underlying network must be traversed. This process sends and receives messages through the socket.

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

What level is TCP/IP?

A

Kernel

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

What does socket API allow us to do?

A

Supports creation of network applications

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

What must exist to develop ICP using a network application?

A

An association

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

How do we represent a socket?

A

As a 5 tuple consisting of protocol, source IP, source port number, destination IP and destination port number

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

What do port numbers do?

A

Uniquely identify a socket.

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

Can same port number be used twice with the same address?

A

negative.

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

What ensures a port number isn’t used twice in the same address?

A

OS

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

What are some common port numbers?

A

80 - standard for web servers

25 - mail

17
Q

How to use sockets server side

A
socket()
bind() - binds socket to IP address 
listen() - listen for client
accept() - if client does connect, you accept it
read()
write()
18
Q

How to use sockets client side

A

socket()
connect()
write()
read()

19
Q

What are well known port numbers?

A

0 - 1023

These require root to use

20
Q

What are ephemeral port numbers?

A

1024- 65535

these can be good temp ports

21
Q

What does accept() do?

A

Takes in a fd of the socket and returns a new fd for reading and writing

22
Q

What internet protocols do we use when creating a socket?

A

AF_INET for ipv4

AF_INET6 for ipv6

23
Q

What are the inputs to socket()?

A

family, type, protocol

fam: AF_INET or AF_INET6
type: SOCK_STREAM for TCP, SOCK_DGRAM for UDP
protocol: 0 (not used for internet sockets)

24
Q

What structs are useful for sockets? Examples.

A

sockaddr, sockaddr_in

25
Q

What do big endian and little endian refer to?

A

Little endian: little end comes first, low order byte stored at lowest memory location
Big endian: high order byte stored at lowest memory location

26
Q

How do we translate a server name into an address?

A

Using struct hostnet, gethostbyname()

27
Q

What’s the difference between stream and datagram sockets?

A

Stream: send long stream of characters, typically implemented on top of TCP
Datagram: send single packet, typically implemented on top of UDP

28
Q

What socket would you typically implement on top of UDP?

A

Datagram, SOCK_DGRAM

29
Q

What socket would you typically implement on top of TCP?

A

Stream, SOCK_STREAM

30
Q

What does sendto do?

A

Sends data to another UDP socket

31
Q

What does subnetting do?

A

Allows the address to act internally as multiple addresses and externally as one

32
Q

What is ICMP?

A

internet control message protocol is used for testing and monitoring ambient conditions between hosts and routers