Foundation: Larry L. Peterson and Bruce S. Davie
Foundation: Larry L. Peterson and Bruce S. Davie
Chapter 1
Foundation
Chapter 1
Problems
How to build a scalable network that will support
different applications?
What is a computer network?
How is a computer network different from other
types of networks?
What is a computer network architecture?
Chapter 1
Chapter 1
Grade Policy
Grading
45%
20%
20%
15%
Each student is expected to do his/her own work, homework assignments are not team efforts in this class. Late assignments will be
sub-ject to a grade penalty of at least 10%. Work more than two
classes late will be graded at 0%.
Chapter 1
Chapter Outline
Applications
Requirements
Network Architecture
Implementing Network Software
Performance
Chapter 1
Chapter Goal
Exploring the requirements that different
applications and different communities place on
the computer network
Introducing the idea of network architecture
Introducing some key elements in implementing
Network Software
Define key metrics that will be used to evaluate
the performance of computer network
Chapter 1
Applications
Most people know about the Internet (a
computer network) through applications
Chapter 1
Example of an application
URL
TCP
HTTP
Chapter 1
Application Protocol
Application Programmer
Network Designer
Chapter 1
Requirements
Network Provider
10
Scale
Link
Nodes
Point-to-point
Multiple access
Switched Network
(a)
(b)
Chapter 1
Connectivity
Circuit Switched
Packet Switched
Packet, message
Store-and-forward
Point-to-point
Multiple access
11
Terminologies (contd.)
(a)
Chapter 1
Connectivity
Cloud
Hosts
Switches
internetwork
Router/gateway
Host-to-host connectivity
Address
Routing
Unicast/broadcast/multicast
(b)
(a)
(b)
A switched network
Interconnection of networks
12
Chapter 1
Strategies
original telephone network
Internet
13
Chapter 1
unicast: node-specific
broadcast: all nodes on the network
multicast: some subset of nodes on the network
14
Multiplexing
De-multiplexing
Synchronous Time-division
Multiplexing
Chapter 1
Time slots/data
transmitted in
predetermined slots
15
Chapter 1
16
Chapter 1
Asynchronous TDM
17
Chapter 1
18
Chapter 1
Request/Reply Channels
Message Stream Channels
19
Chapter 1
Reliability
20
Chapter 1
Network Architecture
Chapter 1
Network Architecture
22
Chapter 1
Protocols
Chapter 1
Interfaces
24
Chapter 1
Protocol Graph
25
Chapter 1
Encapsulation
26
Chapter 1
OSI Architecture
27
Physical Layer
Chapter 1
Description of Layers
Network Layer
Chapter 1
Description of Layers
Transport Layer
Session Layer
Presentation Layer
Application Layer
The transport layer and the higher layers typically run only on endhosts and not on the intermediate switches and routers
29
Chapter 1
ISO Example
30
Chapter 1
Internet Architecture
Chapter 1
Internet Architecture
Defined by IETF
Three main features
32
Chapter 1
33
Chapter 1
34
What is a socket?
Chapter 1
Socket
The point where a local application process attaches
to the network
An interface between an application and the network
An application creates the socket
Creating a socket
Attaching a socket to the network
Sending and receiving messages through the socket
Closing the socket
35
Socket Family
Chapter 1
Socket
PF_INET denotes the Internet family
PF_UNIX denotes the Unix pipe facility
PF_PACKET denotes direct access to the network
interface (i.e., it bypasses the TCP/IP protocol stack)
Socket Type
36
Chapter 1
Creating a Socket
int sockfd = socket(address_family, type, protocol);
37
Chapter 1
Passive open
Prepares to accept connection, does not actually establish a
connection
Server invokes
int bind (int socket, struct sockaddr *address,
int addr_len)
int listen (int socket, int backlog)
int accept (int socket, struct sockaddr *address,
int *addr_len)
38
Chapter 1
Binds the newly created socket to the specified address i.e. the
network address of the local participant (the server)
Address is a data structure which combines IP and port
Listen
39
Chapter 1
40
Chapter 1
Client invokes
int connect (int socket, struct sockaddr *address,
int addr_len)
Connect
41
Chapter 1
42
Chapter 1
43
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
Chapter 1
44
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Chapter 1
45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define SERVER_PORT 5432
#define MAX_PENDING 5
#define MAX_LINE 256
Chapter 1
int main()
{
struct sockaddr_in sin;
char buf[MAX_LINE];
int len;
int s, new_s;
/* build address data structure */
bzero((char *)&sin, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_port = htons(SERVER_PORT);
/* setup passive open */
if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) {
perror("simplex-talk: socket");
exit(1);
}
46
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Chapter 1
47
Chapter 1
Process-per-protocol
Process-per-message
48
Chapter 1
Message Buffers
49
Chapter 1
Performance Measures
Chapter 1
Bandwidth
51
Chapter 1
Performance
Latency = Propagation + transmit + queue
Propagation = distance/relative speed of light
Transmit = size/bandwidth
One bit transmission => propagation is important
Large bytes transmission => bandwidth is important
52
Chapter 1
53
Chapter 1
Chapter 1
Delay X Bandwidth
We think the channel between a pair of processes as a
hollow pipe
Latency (delay) length of the pipe and bandwidth the
width of the pipe
Delay of 50 ms and bandwidth of 45 Mbps
50 x 10-3 seconds x 45 x 106 bits/second
2.25 x 106 bits 280 KB data.
Network as a pipe
55
Chapter 1
Delay X Bandwidth
Relative importance of bandwidth and latency
depends on application
56
Chapter 1
Delay X Bandwidth
How many bits the sender must transmit
before the first bit arrives at the receiver if the
sender keeps the pipe full
Takes another one-way latency to receive a
response from the receiver
If the sender does not fill the pipesend a
whole delay bandwidth products worth of
data before it stops to wait for a signalthe
sender will not fully utilize the network
57
Infinite bandwidth
Chapter 1
Delay X Bandwidth
RTT dominates
Throughput = TransferSize / TransferTime
TransferTime = RTT + 1/Bandwidth x
TransferSize
58
Chapter 1
59
Chapter 1
Summary
60