Network core: packet/circuit switching, internet structure
packet-switching: hosts break application-layer messages into packets
- forward packets from one router to the next, across links on path from source to destination
-
each packet transmitted at full link capacity
-
Is used in the Internet
circuit-switching: an alternative used in legacy telephone networks which was considered during the design of the Internet.
Why circuit switching is not feasible?
- Inefficient
-
Fixed data rate:Computers communicate at very diverse rates. For example, viewing a video vs using telnet or web browsing.
-
Connection state maintenance:
Packet Switching
- Packets consist of a “header” and “payload”;
-
Switches “forward” packets based on their headers;
-
Each packet travels independently.
-
No link resources are reserved. Instead, packet switching leverages statistical multiplexing.
Could the switch start transmitting as soon as it has processed the header?
Yes! This would be called a “cut through” switch(直通交换).But we will always assume a switch processes/forwards a packet after it has received it entirely.This is called “store and forward” switching.
How do packet loss and delay occur?
packets queue in router buffers. 1.packets queue, wait for turn;2.arrival rate to link (temporarily) exceeds output link capacity: packet loss.
Client-server paradigm
server:
-
always-on host
-
permanent IP address
-
often in data centers, for scaling
clients:
-
contact, communicate with server
-
may be intermittently connected
-
may have dynamic IP addresses
-
do not communicate directly with each other
examples: HTTP, IMAP, FTP
Peer-peer architecture
-
no always-on server
-
arbitrary end systems directly communicate
-
peers request service from other peers, provide service in return to other peers
-
peers are intermittently connected and change IP addresses
example: P2P file sharing, blockchain
An application-layer protocol defines
types of messages exchanged:e.g., request, response
message syntax: what fields in messages & how fields are delineated
message semantics: meaning of information in fields
rules for when and how processes send & respond to messages
open protocols:e.g., HTTP, SMTP, WebRTC
proprietary protocols:e.g., Skype, Zoom, Teams
Internet transport protocols services
TCP service:
reliable transport between sending and receiving process
flow control: sender won’t overwhelm receiver
congestion control: throttle sender when network overloaded
does not provide: timing, minimum throughput guarantee, security
connection-oriented: setup required between client and server processes
UDP service:
unreliable data transfer between sending and receiving process
does not provide: reliability, flow control, congestion control, timing, throughput guarantee, security, or connection setup.
Securing TCP
TCP和UDP均没有提供任何的加密机制。因特网界发明了SSL安全套接字层,这提供了进程到进程的安全性服务,注意SSL并非运输层的一个新协议,这是对TCP协议的一种增强,这种增强是应用层实现的。应用进程将明文数据发送给SSL套接字,再由SSL套接字发送给TCP套接字。而接收方的TCP套接字接受到加密数据后发送给SSL套接字,由SSL套接字进行解密。
Web and HTTP
Web page consists of objects, each of which can be stored on different Web servers.
Object can be HTML file, JPEG image, Java applet, audio file,...
Web page consists of base HTML-file which includes several referenced objects, each addressable by a URL, e.g.,
(www.someschool.edu)(/someDept/pic.gif)
host name path name
Uniform Resource Locator (URL)
protocol://host-name[:port]/directory-path/resource
HTTP: hypertext transfer protocol
HTTP uses TCP:
client initiates TCP connection (creates socket) to server, port 80
HTTP is “stateless”: server maintains no information about past client requests