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?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Communicating processes

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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:
    <206.62.226.35, 21, 198.69.10.2, 1499, UDP>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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, …
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Transport service requirements of popular applications

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Internet apps: application, transport protocols

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Python example: UDP echo client

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

Python example: UDP echo server

A
17
Q

Socket programming with TCP

A
  • Recall: TCP provides reliable, in-order byte-stream transfer (“pipe”) between client and server
  • TCP service is connection oriented:
    – When client application creates a socket, the client’s TCP instance establishes a connection to the server’s TCP instance
  • When contacted by client, server TCP creates new socket for server process to communicate with that particular client
18
Q

Python example: TCP echo client

A
19
Q

Python example: TCP echo server

A
20
Q

What about security?

A
  • TCP & UDP have no native encryption
    – e.g., clear-text passwords sent into a socket traverse Internet as clear-text
  • SSL – Secure Socket Layer
    – Provides encrypted TCP connections
    – Also provides end-point authentication
  • SSL is at application layer
    – applications use SSL libraries that “talk” to TCP
  • Now superseded by Transport Layer Security (TLS)