Network Applications Flashcards
1
Q
The TCP/IP Protocol Stack
A
- Internet functionality is split among different layers
- Header encapsulation used to achieve separation of concerns between each layer
- Advantages
- Helps manage complexity through modularity
- Disadvantages
- Performance overheads?
- Redundant functionality?
2
Q
Communicating processes
A
3
Q
Sockets: The interface between Processes and Transport Protocols
A
- The OS provides a so-called “socket” interface to its networking subsystem
- Processes send/receive messages to/from sockets
- Client process: Initiates communication
- Server process: Waits to be contacted
4
Q
Identifying processes remotely
A
- A process is addressed over the network using two identifiers:
– IP address- Network Layer identifier
- 32 bits (IPv4) or 64 bits (IPv6)
– Port number - Transport Layer identifier (16 bits)
- A “5 tuple” uniquely identifies traffic between hosts:
– Two IP addresses, two port numbers, and the underlying transport protocol (e.g., TCP or UDP)- example:
<206.62.226.35, 21, 198.69.10.2, 1500, TCP>
- example:
- example:
<206.62.226.35, 21, 198.69.10.2, 1499, UDP>
5
Q
Why do we need both IP addresses and port numbers?
A
- Many processes may be running on the same host
- IP address is used by routers to forward messages to the correct host
- Then, the host’s OS uses the port number to forward messages to the correct target process
- Example: Request for a Web service
- IP address: 128.2.194.242
- Port: 80
- Example: Request for a Web service
6
Q
Knowing What Port Number To Use
A
- Popular applications have well-known ports
- E.g., port 80 for Web and port 25 for e-mail
- Well-known ports vs. ephemeral ports
- Typically servers have a well-known port (e.g., port 80)
- In range 0-1023 (requires root privileges to use)
- Client picks an unused ephemeral (i.e., temporary) port
- In range 1024 - 65535
- Typically servers have a well-known port (e.g., port 80)
7
Q
UNIX’s Socket API
A
- In UNIX, almost every input and output, physical and virtual, is made to look like a file
- FIles are represented by integer file descriptors
- All input is like reading a file; all output is like writing a file
- So a socket is like a file
- E.g., ‘standard’ system calls are used - like send(), recv(), close()
- Plus some other socket-specific calls
8
Q
Application Layer Protocols
A
- ALP’s are defined by
- Types of messages employed (e.g., request, response, add-new-user, …)
- Message syntax and semantics
- What fields messages have & how they are delineated
- Meaning of information in fields
- When and how processes, send & respond to messages
- Open protocols (e.g., HTTP, SMTP)
- Defined in RFCs
- Allow for interoperability
- Proprietary protocols (e.g., Skype, AppleTalk)
- Tied to specific products
9
Q
What might an application (or ALP) need from a transport service?
A
- Data integrity
– Some apps require 100% reliable data transfer (e.g. file transfer, web transactions)
– Other apps (e.g., audio) can tolerate some loss - Throughput
– Some apps require a minimum level of throughput (e.g. multimedia)
– Other apps can make use of whatever throughput they get (“elastic apps”) - Timing
– Some apps (e.g., Internet telephony, interactive games) require low delay - Security
– Encryption, data integrity, …
10
Q
Transport service requirements of popular applications
A
11
Q
Internet transport protocols (TCP service)
A
- Reliable transport between sending and receiving process
- All sent messages are delivered in correct order
- Flow control: sender can’t overwhelm receiver
-+ Congestion control: sender is throttled when network is overloaded - Connection-oriented: initial setup is required between client and server processes
- Does not provide: timeliness, minimum throughput guarantee, security
12
Q
Internet transport protocols (UDP service)
A
- Unreliable data transfer between sending and receiving process
- Does not provide: reliability in order delivery, flow control, congestion control, timeliness, throughput guarantee, security, or connection setup
- But timeliness may be better than TCP; and less overhead may be incurred for both hosts and the network
13
Q
Internet apps: application, transport protocols
A
14
Q
Socket programming with UDP
A
- No “connection” between client & server
– Sender explicitly attaches IP destination address and port # to each packet
– Receiver extracts sender IP address and port number from received packet
– Messages are called “datagrams”
15
Q
Python example: UDP echo client
A