Download as pdf or txt
Download as pdf or txt
You are on page 1of 152

Ch ơng 1

Giới thiệu

Computer
Networking: A Top
Down Approach
Các silde bài giảng này có nguồn gốc từ J.F. Kurose và K.W Ross

6th edition
All material copyright 1996-2012
J.F Kurose and K.W. Ross, All Rights Reserved
Jim Kurose, Keith Ross
Addison-Wesley
March 2012

Giới thiệu 3-1


Chapter 1
Introduction

A note on the use of these ppt slides:


We’re making these slides freely available to all (faculty, students, readers). Computer
They’re in PowerPoint form so you see the animations; and can add, modify,
and delete slides (including this one) and slide content to suit your needs. Networking: A Top
They obviously represent a lot of work on our part. In return for use, we only
ask the following: Down Approach
 If you use these slides (e.g., in a class) that you mention their source
(after all, we’d like people to use our book!)
6th edition
 If you post any slides on a www site, that you note that they are adapted Jim Kurose, Keith Ross
from (or perhaps identical to) our slides, and note our copyright of this
material.
Addison-Wesley
March 2012
Thanks and enjoy! JFK/KWR

All material copyright 1996-2012


J.F Kurose and K.W. Ross, All Rights Reserved

Giới thiệu 1-2


Ch ơng 1: Mục tiêu cho ng ời học
Hoàn tất ch ơng  Phân tích các nguyên nhân trễ
này sinh viên có gói khác nhau và tính toán trễ
gói toàn phần.
thể:  Trả lời câu hỏi lớp là gì.
 Trả lời câu hỏi  Phân biệt mô hình tham chiếu
Internet là gì. ISO/OSI với bộ giao th c TCP/IP.
 Trả lời câu hỏi giao  Mô tả ch c năng c a các lớp
th c là gì. giao th c và đóng gói.
 Trả lời câu hỏi biên
mạng là gì.
 Trả lời câu hỏi lõi
mạng là gi.

Giới thiệu 1-3


Chapter 1: Learning objectives
After the completion of  Analyze the different sources of
this chapter, students delay and compute the total packet
delay.
will be able to:  Answer the question what a layer is
 Answer the question  Differentiate OSI reference model
what the Internet is. from TCP/IP protocol stack.
 Answer the question  Describe functions of each protocol
what a protocol is. layer and encapsulation as well.
 Answer the question
what the network core
is.
 Answer the question
what the network edge
is.
Giới thiệu 1-4
Ch ơng 1: Giới thiệu
Mục tiêu: Tổng quan:
 Làm quen với các  Internet là gì?
thuật ngữ về mạng  Giao th c là gì?
 ng dụng c a  Biên mạng: Host, mạng truy cập,
mạng máy tính ph ơng tiện truyền dẫn vật lý
 Giao th c mạng  Lõi mạng: chuyển mạch
 Mô hình tham kênh/gói, cấu trúc Internet
chiếu OSI và bộ  Hiệu suất: mất gói, độ trễ, thông
giao th c TCP/IP l ợng
 Cách tiếp cận: lấy  An ninh mạng
Internet làm ví dụ  Lớp giao th c, mô hình dịch vụ
 Lịch sử

Giới thiệu 1-5


Chapter 1: introduction
our goal: overview:
 get feel and  what’s the Internet?
terminology  what’s a protocol?
 network edge; hosts, access net,
 more depth, detail
physical media
later in course  network core: packet/circuit
 approach: switching, Internet structure
 use Internet as  performance: loss, delay,
throughput
example
 security
 protocol layers, service models
 history

Giới thiệu 1-6


Ch ơng 1:
1.1 Internet là gì?
1.2 Biên mạng
 Hệ thống đầu cuối, các mạng truy cập, liên kết
mạng
1.3 Lõi mạng
 Chuyển mạch gói, chuyển mạch kênh, cấu trúc
mạng
1.4 Trễ, mất gói, thông l ợng
1.5 Các lớp giao th c, các mô hình dịch vụ
1.6 Tấn công mạng: An ninh mạng
1.7 Lịch sử
Giới thiệu 1-7
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
 end systems, access networks, links
1.3 network core
 packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Giới thiệu 1-8


Internet là gì? Góc nhìn cơ bản
 Hàng triệu thiết bị tính
Mạng di động
toán đ ợc kết nối với
PC
server
nhau: ISP toàn cục
wireless
laptop  Hệ thống đầu cuối
smartphone  Chạy các ng dụng
Mạng gia đình
mạng.
ISP khu vực
Đ ờng truyền thông tin
wireless
links  Cáp đồng, cáp
wired
links quang, radio, vệ tinh
 Tốc độ truyền dẫn:
băng thông
 Thiết bị chuyển mạch:
router chuyển tiếp các gói dữ
Mạng công sở
liệu
 router và switch Giới thiệu 1-9
What’s the Internet: nuts and bolts view
PC mobile network
 millions of connected
server computing devices:
wireless  hosts = end systems global ISP
laptop
smartphone  running network apps
home
 communication links network
regional ISP
wireless  fiber, copper, radio,
links satellite
wired
links  transmission rate:
bandwidth

 Packetswitches: forward
router packets (chunks of data) institutional
network
 routers and switches
Giới thiệu 1-10
Nhiều thiết bị có thể kết nối Internet

Web-enabled toaster +
weather forecaster

IP picture frame
http://www.ceiva.com/

Tweet-a-watt:
monitor energy use

Slingbox: watch,
control cable TV remotely
Internet
refrigerator Internet phones
Giới thiệu 1-11
Fun internet appliances

Web-enabled toaster +
weather forecaster

IP picture frame
http://www.ceiva.com/

Tweet-a-watt:
monitor energy use

Slingbox: watch,
control cable TV remotely
Internet
refrigerator Internet phones
Introduction 1-12
Internet là gì? Góc nhìn cơ bản
mobile network
 Internet: mạng c a các mạng
 Các ISP đ ợc kết nối với global ISP
nhau
 giao th c điều khiển việc gửi và
nhận các thông điệp home
network
 vd: TCP, IP, HTTP, Skype, regional ISP
802.11
 Các chuẩn Internet
 RFC: Request for comments
 IETF: Internet Engineering
Task Force
institutional
network

Giới thiệu 1-13


What’s the Internet: nuts and bolts view
mobile network
 Internet: network of networks
 Interconnected ISPs
global ISP
 protocols control sending,
receiving of msgs
 e.g., TCP, IP, HTTP, Skype, 802.11 home
network
 Internet standards regional ISP
 RFC: Request for comments
 IETF: Internet Engineering Task
Force

institutional
network

Introduction 1-14
Internet là gì? Góc nhìn dịch vụ
 Cơ sở hạ tầng cung cấp
các dịch vụ cho các ng
mobile network

dụng mạng: global ISP


 Web, VoIP, email, trò chơi,
th ơng mại điện tử, mạng xã
hội … home
 Cung cấp các giao diện network
regional ISP
lập trình cho các ng
dụng mạng
 Các công cụ cho phép các ng
dụng gửi và nhận dữ liệu kết
nối với Internet
 Cung cấp các loại hình dịch vụ
t ơng tự nh các dịch vụ b u
chính institutional
network

Giới thiệu 1-15


What’s the Internet: a service view
mobile network
 Infrastructure that provides
services to applications: global ISP

 Web, VoIP, email, games, e-


commerce, social nets, … home
network
 provides programming regional ISP
interface to apps
 hooks that allow sending
and receiving app programs
to connect to Internet
 provides service options,
analogous to postal service
institutional
network

Introduction 1-16
Giao th c là gì?
Giao th c c a con ng ời: Giao th c mạng:
 “mấy giờ rồi?”  Maý ch không phải
 “tôi có câu hỏi” ng ời
 Giới thiệu  Tất cả các hoạt động
thông tin trên Internet
đều phải tuân theo các
… thông điệp cụ thể giao th c
đ ợc gửi đi
… các hành động cụ Giao th c xác định khuôn
thể cần làm khi nhận dạng, trật tự c a các thông
đ ợc thông điệp, hoặc điệp đ ợc gửi và nhận giữa
các sự kiện khác … các thực thể mạng, và các
hành động cần làm khi gửi
và nhận thông điệp
Giới thiệu 1-17
What’s a protocol?
human protocols: network protocols:
 what’s the time?  machines rather than
 I have a question humans
 introductions  all communication activity
in Internet governed by
protocols
… specific msgs sent
… specific actions taken
when msgs received, or protocols define format, order
other events
of msgs sent and received
among network entities,
and actions taken on msg
transmission, receipt
Introduction 1-18
Giao th c là gì?
Giao th c con ng ời và Giao th c mạng:

Chào ông
Yêu cầu kết nối
TCP
Chào bà
Chấp nhận kết nối
TCP
Mấy giờ rồi?
Get http://www.awl.com/kurose-ross
2:00 giờ
<file>
Thời gian

Giới thiệu 1-19


What’s a protocol?
a human protocol and a computer network protocol:

Hi TCP connection
request
Hi TCP connection
response
Got the
time? Get http://www.awl.com/kurose-ross
2:00
<file>
time

Q: other human protocols?


Introduction 1-20
Ch ơng 1:
1.1 Internet là gì?
1.2 Biên mạng
 Hệ thống đầu cuối, các mạng truy cập, liên kết
mạng
1.3 Lõi mạng
 Chuyển mạch gói, chuyển mạch kênh, cấu trúc
mạng
1.4 Trễ, mất gói, thông l ợng
1.5 Các lớp giao th c, các mô hình dịch vụ
1.6 Tấn công mạng: An ninh mạng
1.7 Lịch sử
Giới thiệu 1-21
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
 end systems, access networks, links
1.3 network core
 packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Giới thiệu 1-22


Chi tiết hơn về cấu trúc c a mạng
 Biên mạng: mobile network

 Hệ thống đầu cuối:


global ISP
client và server
 Server : Data center
home
 Mạng truy cập, đ ờng network

truyền vật lý: các liên


regional ISP

kết truyền thông có dây


và không dây

 Lõi mạng:
 Các router kết nối với
nhau institutional
 Mạng c a các mạng network

Giới thiệu 1-23


A closer look at network structure:
 network edge: mobile network

 hosts: clients and servers


global ISP
 servers often in data
centers
home
 access networks, physical network
regional ISP
media: wired, wireless
communication links

 network core:
 interconnected routers
 network of networks institutional
network

Introduction 1-24
Mạng truy cập và đ ờng truyền vật lý
Q: Làm thế nào để kết
nối hệ thống đầu cuối
với router biên?
 Mạng truy cập ở nơi c
trú
 Mạng truy cập ở công sở
(tr ờng học, công ty)
 Mạng truy cập di động
Ghi nhớ:
 Băng thông (bit trên
giây) c a mạng truy cập?
 Dùng chung hay dùng
riêng?
Giới thiệu 1-25
Access networks and physical media

Q: How to connect end


systems to edge router?
 residential access nets
 institutional access
networks (school,
company)
 mobile access networks
keep in mind:
 bandwidth (bits per second)
of access network?
 shared or dedicated?

Giới thiệu 1-26


Mạng truy cập: Đ ờng thuê bao số (DSL)

central office telephone


network

DSL splitter
modem DSLAM

ISP
voice, data transmitted
at different frequencies over DSL access
dedicated line to central office multiplexer

 Dùng đ ờng điện thoại có sẵn nối đến DSLAM c a tổng đài
 Dữ liệu trên đ ờng DSL đi đến Internet
 Thoại trên đ ờng DSL đi đến mạng điện thoại
 tốc độ truyền dẫn đ ờng lên < 2.5 Mbps (điển hình < 1 Mbps)
 tốc độ truyền dẫn đ ờng xuống < 24 Mbps (điển hình < 10 Mbps)

Giới thiệu 1-27


Access net: digital subscriber line (DSL)
central office telephone
network

DSL splitter
modem DSLAM

ISP
voice, data transmitted
at different frequencies over DSL access
dedicated line to central office multiplexer

 use existing telephone line to central office DSLAM


 data over DSL phone line goes to Internet
 voice over DSL phone line goes to telephone net
 < 2.5 Mbps upstream transmission rate (typically < 1 Mbps)
 < 24 Mbps downstream transmission rate (typically < 10 Mbps)
Giới thiệu 1-28
Mạng truy cập: Mạng cáp
cable headend

cable splitter
modem

C
O
V V V V V V N
I I I I I I D D T
D D D D D D A A R
E E E E E E T T O
O O O O O O A A L

1 2 3 4 5 6 7 8 9

Channels

Ghép kênh phân chia theo tần số: các kênh khác nhau
đ ợc phát trên các băng tần khác nhau
Giới thiệu 1-29
Access net: cable network
cable headend

cable splitter
modem

C
O
V V V V V V N
I I I I I I D D T
D D D D D D A A R
E E E E E E T T O
O O O O O O A A L

1 2 3 4 5 6 7 8 9

Channels

frequency division multiplexing: different channels transmitted


in different frequency bands
Giới thiệu 1-30
Mạng truy cập: Mạng cáp
cable headend

cable splitter cable modem


modem CMTS termination system

data, TV transmitted at different


frequencies over shared cable ISP
distribution network

 HFC: hỗn hợp cáp đồng trục và cáp quang


 Bất đối x ng: tốc độ đ ờng lên lên đến 30Mbps, tốc
độ đ ờng xuống2 Mbps
 kết nối hộ gia đình đến router c a ISP
 Sử dụng mạng cáp kết nối đến cable headend

Giới thiệu 1-31


Access net: cable network
cable headend

cable splitter cable modem


modem CMTS termination system

data, TV transmitted at different


frequencies over shared cable ISP
distribution network

 HFC: hybrid fiber coax


 asymmetric: up to 30Mbps downstream transmission rate, 2
Mbps upstream transmission rate
 network of cable, fiber attaches homes to ISP router
 homes share access network to cable headend
 unlike DSL, which has dedicated access to central office
Giới thiệu 1-32
Mạng truy cập: Mạng gia đình
wireless
devices

to/from headend or
central office
often combined
in single box

cable or DSL modem

wireless access router, firewall, NAT


point (54 Mbps)
wired Ethernet (100 Mbps)

Giới thiệu 1-33


Access net: home network
wireless
devices

to/from headend or
central office
often combined
in single box

cable or DSL modem

wireless access router, firewall, NAT


point (54 Mbps)
wired Ethernet (100 Mbps)

Giới thiệu 1-34


Mạng truy cập ở công sở (Ethernet)

institutional link to
ISP (Internet)
institutional router

Ethernet institutional mail,


switch web servers

 Phổ biến ở công ty, tr ờng đại học, …


 Tốc độ truyền dẫn 10 Mbps, 100Mbps, 1Gbps, 10Gbps
 Hiện nay, các hệ thống đầu cuối kết nối vào một
Ethernet switch
Giới thiệu 1-35
Enterprise access networks (Ethernet)

institutional link to
ISP (Internet)
institutional router

Ethernet institutional mail,


switch web servers

 typically used in companies, universities, etc


 10 Mbps, 100Mbps, 1Gbps, 10Gbps transmission rates
 today, end systems typically connect into Ethernet switch

Giới thiệu 1-36


Mạng truy cập không dây
 Mạng truy cập không dây dùng chung kết nối hệ thống
đầu cuối với router
 Thông qua một trạm gốc còn gọi là điểm truy cập
LAN không dây: Truy cập không dây diện rộng
 Bên trong nhà (phạm vi 100 m)  Cung cấp bởi công ty viễn thông,
 802.11b/g (WiFi): tốc độ 11, 54 phạm vi 10 km
Mbps  Tốc độ từ 1 đến 10 Mbps
 3G, 4G: LTE

to Internet

to Internet

Giới thiệu 1-37


Wireless access networks
 shared wireless access network connects end system to router
 via base station aka access point

wireless LANs: wide-area wireless access


 within building (100 ft)  provided by telco (cellular)
 802.11b/g (WiFi): 11, 54 Mbps operator, 10’s km
transmission rate  between 1 and 10 Mbps
 3G, 4G: LTE

to Internet

to Internet

Giới thiệu 1-38


Hệ thống đầu cuối: phát gói dữ liệu
Ch c năng phát gói c a hệ
thống đầu cuối: Hệ thống đầu cuối
Nhận thông điệp ng dụng
Hai gói,
Chia ra các đoạn nhỏ gồm L
L bít/gói
bit gọi chung là gói
Phát gói vào mạng truy cập
với tốc độ truyền dẫn R
 Tốc độ truyền dẫn c a 2 1
liên kết còn gọi là dung
l ợng hoặc băng thông R: tốc độ truyền dẫn của liên kết
c a liên kết

Độ trễ Thời gian L (bit)


truyền dẫn = cần để phát L bit =
c a gói vào kiên kết R (bit/sec)
Giới thiệu 1-39
Host: sends packets of data
host sending function:
 takes application message
 breaks into smaller two packets,
chunks, known as packets, L bits each
of length L bits
 transmits packet into
access network at 2 1
transmission rate R R: link transmission rate
 link transmission rate, host
aka link capacity, aka
link bandwidth

packet time needed to L (bits)


transmission = transmit L-bit =
delay packet into link R (bits/sec)
Giới thiệu 1-40
Đ ờng truyền vật lý

 bit: lan truyền giữa các cặp


bộ phát/bộ thu
 Liên kết vật lý: nằm giữa bộ Cáp xoắn đôi (TP)
phát và bộ thu  Hai dây đồng cách điện
 Đ ờng truyền định h ớng:  Cat 5: 100 Mbps, 1 Gpbs
Ethernet
 Tín hiệu lan truyền theo  Cat 6: 10Gbps
một đ ờng cố định: cáp
đồng, cáp đồng trục, cáp
quang
 Đ ờng truyền vô h ớng:
 Tín hiệu lan truyền tự
do, vd. Sóng vô tuyến

Giới thiệu 1-41


Physical media
 bit: propagates between
transmitter/receiver pairs
 physical link: what lies twisted pair (TP)
between transmitter &  two insulated copper
receiver wires
 guided media:  Category 5: 100 Mbps, 1
Gpbs Ethernet
 signals propagate in solid  Category 6: 10Gbps
media: copper, fiber, coax
 unguided media:
 signals propagate freely,
e.g., radio

Giới thiệu 1-42


Đ ờng truyền vật lý: cáp đồng trục, cáp quang

Cáp đồng trục: Cáp quang:


 Hai đ ờng dẫn bằng  Sợi th y tinh truyền xung
đồng đồng tâm ánh sáng, mỗi xung một
 Hai chiều bit
 Băng rộng:  Tốc độ cao:
 nhiều kênh trên một cáp  Truyền dẫn điểm-điểm tốc
 HFC độ cao (vd, 10-100’s Gpbs )
 Tỷ lệ lỗi bit thấp:
 Các trạm lặp cách xa nhau
 Miễn nhiễm với nhiễu điện từ

Giới thiệu 1-43


Physical media: coax, fiber
coaxial cable: fiber optic cable:
 two concentric copper  glass fiber carrying light
conductors pulses, each pulse a bit
 bidirectional  high-speed operation:
 broadband:  high-speed point-to-point
 multiple channels on cable transmission (e.g., 10’s-100’s
Gpbs transmission rate)
 HFC
 low error rate:
 repeaters spaced far apart
 immune to electromagnetic
noise

Giới thiệu 1-44


ường truyền vật lý: Sóng vô tuyến
 Tín hiệu đ ợc mang Các kiểu liên kết vô tuyến
trong phổ sóng điện từ  Vi ba mặt đất
 Không có “dây dẫn”  Tốc độ lên đến 45 Mbps
 Hai chiều  LAN (vd, Wi-Fi)
 Chịu tác động nhiều từ  11Mbps, 54 Mbps
tác nhân bên ngoài:  Phạm vi rộng (vd, di động)
 phản xạ  3G : ~ vài Mbps
 cản trở bởi vật thể  Vệ tinh
 giao thoa/nhiễu  Vài Kbps đến 45Mbps
 Trễ đầu cuối-đầu cuối 270
msec
 Quỹ đạo thấp và Địa tĩnh

Giới thiệu 1-45


Physical media: radio
 signal carried in radio link types:
electromagnetic spectrum  terrestrial microwave
 no physical wire  e.g. up to 45 Mbps channels
 bidirectional  LAN (e.g., WiFi)
 propagation environment  11Mbps, 54 Mbps
effects:  wide-area (e.g., cellular)
 reflection  3G cellular: ~ few Mbps
 obstruction by objects  satellite
 interference  Kbps to 45Mbps channel (or
multiple smaller channels)
 270 msec end-end delay
 geosynchronous versus low
altitude

Giới thiệu 1-46


Ch ơng 1:
1.1 Internet là gì?
1.2 Biên mạng
 Hệ thống đầu cuối, các mạng truy cập, liên kết
mạng
1.3 Lõi mạng
 Chuyển mạch gói, chuyển mạch kênh, cấu trúc
mạng
1.4 Trễ, mất gói, thông l ợng
1.5 Các lớp giao th c, các mô hình dịch vụ
1.6 Tấn công mạng: An ninh mạng
1.7 Lịch sử
Giới thiệu 1-47
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
 end systems, access networks, links
1.3 network core
 packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Giới thiệu 1-48


Lõi mạng
 Các router đ ợc kết nối
chằng chịt với nhau
 Chuyển mạch gói: hệ
thống đầu cuối chia
thông điệp ng dụng
thành các gói
 Các gói đ ợc chuyển tiếp
từ router này đến router
kế tiếp trên đ ờng đi từ
nguồn đến đích
 Mỗi gói đ ợc truyền với
tốc độ tối đa c a liên kết

Giới thiệu 1-49


The network core
 mesh of interconnected
routers
 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

Giới thiệu 1-50


Chuyển mạch gói: L u và chuyển tiếp

Các gói với


độ dài L bit

3 2 1
Nguồn đích
R bps R bps

 Tốn L/R giây để phát một Ví dụ bằng số cho một


gói L-bit vào liên kết với chặng:
tốc độ R bps
 L u và chuyển tiếp: toàn  L = 7.5 Mbits
bộ gói phải đến router  R = 1.5 Mbps
tr ớc khi nó đ ợc phát  Trễ truyền dẫn một
đến router kế tiếp chặng = 5 sec
 Trễ đầu cuối-đầu cuối = 2L/R
(giả sử trễ truyền lan bằng Sẽ bàn về các loại trễ sau …
không) Giới thiệu 1-51
Packet-switching: store-and-forward

L bits
per packet

3 2 1
source destination
R bps R bps

 takes L/R seconds to one-hop numerical example:


transmit (push out) L-bit
packet into link at R bps  L = 7.5 Mbits
 store and forward: entire  R = 1.5 Mbps
packet must arrive at router  one-hop transmission
before it can be transmitted delay = 5 sec
on next link
 end-end delay = 2L/R (assuming
zero propagation delay) more on delay shortly …
Giới thiệu 1-52
Chuyển mạch gói: trễ xếp hàng, rớt gói

R = 100 Mb/s C
A
D
R = 1.5 Mb/s
B
Hàng đợi các gói E
đang chờ phát ra liên kết

Trễ xếp hàng và rớt gói:


 Nếu tốc độ c a liên kết đến v ợt quá tốc độ c a liên kết
đi trong một khoảng thời gian:
 Các gói phải xếp hàng, đợi để đ ợc phát lên liên kết đi
 Các gói có thể bị rớt (mất) nếu bộ nhớ đệm đầy

Giới thiệu 1-53


Packet Switching: queueing delay, loss

R = 100 Mb/s C
A
D
R = 1.5 Mb/s
B
queue of packets E
waiting for output link

queuing and loss:


 If arrival rate (in bits) to link exceeds transmission rate of
link for a period of time:
 packets will queue, wait to be transmitted on link
 packets can be dropped (lost) if memory (buffer) fills up

Giới thiệu 1-54


Hai ch c năng chính c a lõi mạng
Định tuyến: xác định đ ờng Chuyển tiếp: chuyển các gói
đi từ nguồn đến đích c a các từ đầu vào c a router đến
gói đầu ra thích hợp c a router
 Các thuật toán định tuyến

Thuật toán định tuyến

Bảng chuyển tiếp cục bộ


Giá trị mào đầu Liên kết ra
0100 3 1
0101 2
0111 2 3 2
1001 1

Địa chỉ đích trong


mào đầu c a gói đến router
Giới thiệu 4-55
Two key network-core functions
routing: determines source- forwarding: move packets from
destination route taken by router’s input to appropriate
packets router output
 routing algorithms

routing algorithm

local forwarding table


header value output link
0100 3 1
0101 2
0111 2 3 2
1001 1

dest address in arriving


packet’s header
Giới thiệu 4-56
Một lõi mạng khác: chuyển mạch kênh
Tài nguyên c a toàn tuyến
đ ợc dành cho “cuộc gọi”
giữa nguồn và đích:
 Trong hình vẽ, mỗi liên kết có 4
kênh.
 Cuộc gọi chiếm kênh 2 c a liên
kết phía trên và kênh 1 c a
liên kết bên phải.
 Tài nguyên dành riêng: không
chia xẻ
 Hiệu suất cao
 Kênh rỗi nếu cuộc gọi không dùng
 Th ờng dùng trong mạng thoại
truyền thống

Giới thiệu 1-57


Alternative core: circuit switching
end-end resources allocated
to, reserved for call
between source & dest:
 In diagram, each link has four
circuits.
 call gets 2nd circuit in top
link and 1st circuit in right
link.
 dedicated resources: no sharing
 circuit-like (guaranteed)
performance
 circuit segment idle if not used
by call (no sharing)
 Commonly used in traditional
telephone networks
Giới thiệu 1-58
Chuyển mạch kênh: FDM so với TDM
Example:
FDM
4 users

frequency

time
TDM

frequency

time
Giới thiệu 1-59
Circuit switching: FDM versus TDM
Example:
FDM
4 users

frequency

time
TDM

frequency

time
Giới thiệu 1-60
Chuyển mạch gói so với chuyển mạch kênh
Chuyển mạch gói cho phép nhiều ng ời dùng mạng hơn!

Ví dụ:
 Liên kết 1 Mb/s
 Mỗi ng ời dùng: N
users
• Sử dụng100 kb/s
• Sử dụng 10% thời gian 1 Mbps link

 Chuyển mạch kênh


 10 ng ời dùng
 Chuyển mạch gói Q: Tính ra 0.0004 nh thế nào?
 Với 35 ng ời dùng, xác
suất > 10 ng ời sử dụng Q: Nếu có hơn 35 ng ời dùng
mạng cùng lúc nhỏ hơn thì sao ?
.0004 *
Giới thiệu 1-61
Packet switching versus circuit switching
packet switching allows more users to use network!

example:
 1 Mb/s link
 each user: N
users
• 100 kb/s when active
• active 10% of time 1 Mbps link

 circuit-switching:
 10 users
 packet switching: Q: how did we get value 0.0004?
 with 35 users, probability >
10 active at same time is less Q: what happens if > 35 users ?
than .0004 *

* Check out the online interactive exercises for more examples Giới thiệu 1-62
Chuyển mạch gói so với chuyển mạch kênh
Chuyển mạch gói hoàn toàn v ợt trội?
 Phù hợp với dữ liệu không đều
 chia sẻ tài nguyên
 đơn giản, ko yêu cầu khởi tạo cuộc gọi
 Tắc nghẽn quá m c: gói tin bị trễ và mất
 cần có các giao th c cho việc truyền tải dữ liệu tin cậy, kiểm
soát tắc nghẽn.
 Hỏi: làm thế nào để cung cấp dịch vụ t ơng tự nh
chuyển mạch kênh?
 băng thông cần đảm bảo cho các ng dụng thời gian thực

Giới thiệu 1-63


Packet switching versus circuit switching
is packet switching a slam dunk winner?
 great for bursty data
 resource sharing
 simpler, no call setup
 excessive congestion possible: packet delay and loss
 protocols needed for reliable data transfer, congestion
control
 Q: How to provide circuit-like behavior?
 bandwidth guarantees needed for audio/video apps
 still an unsolved problem (chapter 7)

Q: human analogies of reserved resources (circuit switching)


versus on-demand allocation (packet-switching)?
Giới thiệu 1-64
Cấu trúc Internet: mạng c a các mạng
 Các hệ thống đầu cuối kết nối Internet thông qua các
ISP (Nhà cung cấp dịch vụ Internet)
 Các ISP cho hộ c trú, cho công ty, cho các tr ờng
đại học
 Các ISP phải đ ợc kết nối với nhau.
 Để cho hai hệ thống đầu cuối bất kỳ có thể phát gói
cho nhau
 Kết quả là một mạng c a các mạng rất ph c tạp
 Sự phát triển bị chi phối bởi các chính sách kinh tế và
quốc gia
 Để thấy đ ợc cấu trúc c a Internet hiện nay cần phải
tiếp cận từng b ớc

Giới thiệu 1-65


Internet structure: network of networks
 End systems connect to Internet via access ISPs (Internet
Service Providers)
 Residential, company and university ISPs
 Access ISPs in turn must be interconnected.
 So that any two hosts can send packets to each other
 Resulting network of networks is very complex
 Evolution was driven by economics and national policies
 Let’s take a stepwise approach to describe current Internet
structure

Giới thiệu 1-66


Cấu trúc Internet: mạng c a các mạng
Hỏi: Làm thế nào để kết nối hàng triệu các ISP với nhau ?

access access
net net
access
net
access
access net
net
access
access net
net

access access
net net

access
net
access
net

access
net
access
net
access access
net access net
net

Giới thiệu 1-67


Cấu trúc Internet: mạng c a các mạng
Ph ơng án: kết nối từng ISP với mọi ISP?

access access
net net
access
net
access
access net
net
access
access net
net

Việc kết nối trực tiếp từng ISP


access
là không thể: O(N2) kết nối. access
net net

access
net
access
net

access
net
access
net
access access
net access net
net

Giới thiệu 1-68


Internet structure: network of networks
Question: given millions of access ISPs, how to connect them
together?
access access
net net
access
net
access
access net
net
access
access net
net

access access
net net

access
net
access
net

access
net
access
net
access access
net access net
net

Giới thiệu 1-69


Internet structure: network of networks
Option: connect each access ISP to every other access ISP?

access access
net net
access
net
access
access net
net
access
access net
net

connecting each access ISP


access
to each other directly doesn’t access
net
scale: O(N2) connections. net

access
net
access
net

access
net
access
net
access access
net access net
net

Giới thiệu 1-70


Cấu trúc Internet: mạng c a các mạng
Ph ơng án: kết nối từng ISP truy cập với một ISP toàn
cục? Các ISP khách hàng và các ISP cung cấp có thỏa
thuận kinh tế.
access access
net net
access
net
access
access net
net
access
access net
net

ISP toàn
access
net
cục access
net

access
net
access
net

access
net
access
net
access access
net access net
net

Giới thiệu 1-71


Cấu trúc Internet: mạng c a các mạng
Thế nh ng nếu một ISP toàn cục là viable business, sẽ có
nhiều ng ời cạnh tranh ….
access access
net net
access
net
access
access net
net
access
access net
net
ISP A

access access
net ISP B net

access
ISP C
net
access
net

access
net
access
net
access access
net access net
net

Giới thiệu 1-72


Cấu trúc Internet: mạng c a các mạng
Thế nh ng nếu một ISP toàn cục là viable business, sẽ có
nhiều ng ời cạnh tranh …. họ cần kết nối với nhau
access access
Internet exchange point
net net
access
net
access
access net
net

access
IXP access
net
net
ISP A

access IXP access


net ISP B net

access
ISP C
net
access
net

access peering link


net
access
net
access access
net access net
net

Giới thiệu 1-73


Cấu trúc Internet: mạng c a các mạng
… và xuất hiện các mạng khu vực để kết nối các mạng
truy cập đến các ISP
access access
net net
access
net
access
access net
net

access
IXP access
net
net
ISP A

access IXP access


net ISP B net

access
ISP C
net
access
net

access
net regional net
access
net
access access
net access net
net

Giới thiệu 1-74


Cấu trúc Internet: mạng c a các mạng
… và các nhà mạng cung cấp nội dung (vd, Google,
Microsoft, Akamai ) có thể điều hành các mạng riêng c a
họ để mang lại các dịch vụ và nội dung cho ng ời dùng ở
đầu cuối access
net
access
net
access
net
access
access net
net

access
IXP access
net
net
ISP A
Content provider network
access IXP access
net ISP B net

access
ISP B
net
access
net

access
net regional net
access
net
access access
net access net
net

Giới thiệu 1-75


Internet structure: network of networks
Option: connect each access ISP to a global transit ISP? Customer
and provider ISPs have economic agreement.
access access
net net
access
net
access
access net
net
access
access net
net

global
access
net
ISP access
net

access
net
access
net

access
net
access
net
access access
net access net
net

Giới thiệu 1-76


Internet structure: network of networks
But if one global ISP is viable business, there will be competitors
….
access access
net net
access
net
access
access net
net
access
access net
net
ISP A

access access
net ISP B net

access
ISP C
net
access
net

access
net
access
net
access access
net access net
net

Giới thiệu 1-77


Internet structure: network of networks
But if one global ISP is viable business, there will be competitors
…. which must be interconnected
access access
Internet exchange point
net net
access
net
access
access net
net

access
IXP access
net
net
ISP A

access IXP access


net ISP B net

access
ISP C
net
access
net

access peering link


net
access
net
access access
net access net
net

Giới thiệu 1-78


Internet structure: network of networks
… and regional networks may arise to connect access nets to
ISPS
access access
net net
access
net
access
access net
net

access
IXP access
net
net
ISP A

access IXP access


net ISP B net

access
ISP C
net
access
net

access
net regional net
access
net
access access
net access net
net

Giới thiệu 1-79


Internet structure: network of networks
… and content provider networks (e.g., Google, Microsoft,
Akamai ) may run their own network, to bring services, content
close to end users
access access
net net
access
net
access
access net
net

access
IXP access
net
net
ISP A
Content provider network
access IXP access
net ISP B net

access
ISP B
net
access
net

access
net regional net
access
net
access access
net access net
net

Giới thiệu 1-80


Cấu trúc Internet: mạng c a các mạng

ISP Tier 1 ISP Tier 1 Google

IXP IXP IXP

ISP khu vực ISP khu vực

access access access access access access access access


ISP ISP ISP ISP ISP ISP ISP ISP

 ở trung tâm: một số ít các mạng lớn đ ợc kết nối với nhau
 Các ISP th ơng mại tier-1 (e.g., Level 3, Sprint, AT&T, NTT),
phạm vi quốc tế hoặc quốc gia
 Mạng cung cấp nội dung (e.g, Google): các mạng riêng kết nối các
Data center c a nó với Internet, th ờng bỏ qua các ISP tier-1, các
ISP khu vực Giới thiệu 1-81
Internet structure: network of networks

Tier 1 ISP Tier 1 ISP Google

IXP IXP IXP

Regional ISP Regional ISP

access access access access access access access access


ISP ISP ISP ISP ISP ISP ISP ISP

 at center: small # of well-connected large networks


 tier-1 commercial ISPs (e.g., Level 3, Sprint, AT&T, NTT), national &
international coverage
 content provider network (e.g, Google): private network that connects
it data centers to Internet, often bypassing tier-1, regional ISPs Giới thiệu 1-82
ISP bậc 1: vd, Sprint
POP: point-of-presence

to/from backbone

peering
… … …

to/from customers

Giới thiệu 1-83


Tier-1 ISP: e.g., Sprint
POP: point-of-presence

to/from backbone

peering
… … …

to/from customers

Giới thiệu 1-84


Ch ơng 1:
1.1 Internet là gì?
1.2 Biên mạng
 Hệ thống đầu cuối, các mạng truy cập, liên kết
mạng
1.3 Lõi mạng
 Chuyển mạch gói, chuyển mạch kênh, cấu trúc
mạng
1.4 Trễ, mất gói, thông l ợng
1.5 Các lớp giao th c, các mô hình dịch vụ
1.6 Tấn công mạng: An ninh mạng
1.7 Lịch sử
Giới thiệu 1-85
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
 end systems, access networks, links
1.3 network core
 packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Giới thiệu 1-86


Nguồn gốc c a trễ và mất gói
Các gói xếp hàng tại bộ đệm c a router
 Tốc độ ở liên kết vào v ợt quá dung l ợng c a liên kết ra
 Các gói phải xếp hàng, chờ đến l ợt

Gói đang được phát (trễ)

B
Các gói đang xếp hàng chờ (trễ)
Phần còn trống c a bộ đệm: các gói đến sẽ bị rớt (mất)
nếu bộ đệm không còn trống

Giới thiệu 1-87


How do loss and delay occur?
packets queue in router buffers
 packet arrival rate to link (temporarily) exceeds output link
capacity
 packets queue, wait for turn
packet being transmitted (delay)

B
packets queueing (delay)
free (available) buffers: arriving packets
dropped (loss) if no free buffers

Giới thiệu 1-88


Bốn nguyên nhân c a trễ gói
Truyền dẫn
A Lan truyền

B
Xử lý
Xếp hàng

dnodal = dproc + dqueue + dtrans + dprop

dproc: trễ xử lý tại nút mạng dqueue: trễ xếp hàng


 Kiểm tra lỗi bit  Thời gian đợi tại đầu ra
 Xác định liên kết ra để đ ợc phát đi
 Điển hình < msec  Phụ thuộc vào m c độ
tắc nghẽn c a router
Giới thiệu 1-89
Four sources of packet delay
transmission
A propagation

B
nodal
processing queueing

dnodal = dproc + dqueue + dtrans + dprop

dproc: nodal processing dqueue: queueing delay


 check bit errors  time waiting at output link
 determine output link for transmission
 typically < msec  depends on congestion
level of router
Giới thiệu 1-90
Bốn nguyên nhân c a trễ gói
Truyền dẫn
A Lan truyền

B
Xử lý
Xếp hàng

dnodal = dproc + dqueue + dtrans + dprop

dtrans: trễ truyền dẫn dprop: trễ lan truyền


 L: độ dài gói (bit)  d: chiều dài liên kết vật lý
 R: băng thông liên kết (bps)  s: tốc độ truyền lan trong
 dtrans = L/R môi tr ờng (~2x108 m/sec)
 dprop = d /s
dtrans và dprop
rất khác nhau Giới thiệu 1-91
Four sources of packet delay
transmission
A propagation

B
nodal
processing queueing

dnodal = dproc + dqueue + dtrans + dprop

dtrans: transmission delay: dprop: propagation delay:


 L: packet length (bits)  d: length of physical link
 R: link bandwidth (bps)  s: propagation speed in medium
 dtrans = L/R (~2x108 m/sec)
dtrans and dprop  dprop = d/s
very different
* Check out the Java applet for an interactive animation on trans vs. prop delay Giới thiệu 1-92
Đoàn xe diễu hành
100 km 100 km
Đoàn xe diễu hành Trạm Trạm
Gồm 10 chiếc Dịch vụ Dịch vụ

 Xe lan truyền với tốc độ  Thời gian làm dịch vụ


100 km/h cho cả đoàn xe =
 Trạm tốn 12 sec làm dịch 12*10 = 120 sec
vụ cho 1 xe (thời gian  Thời gian để xe cuối
truyền dẫn 1 bit) đoàn “lan truyền” đến
 Xe~bit; đoàn xe ~ gói trạm th hai:
 Hỏi: Sau bao lâu đoàn xe 100km/(100km/h)= 1
đến tr ớc trạm dịch vụ th h
hai?  Trả lời: 62 phút

Giới thiệu 1-93


Caravan analogy
100 km 100 km
ten-car toll toll
caravan booth booth

 cars propagate at  time to push entire


100 km/hr caravan through toll
 toll booth takes 12 sec to booth onto highway =
service car (bit transmission 12*10 = 120 sec
time)  time for last car to
 car~bit; caravan ~ packet propagate from 1st to
 Q: How long until caravan is 2nd toll both:
lined up before 2nd toll 100km/(100km/hr)= 1
booth? hr
 A: 62 minutes
Giới thiệu 1-94
Đoàn xe diễu hành (tt)
100 km 100 km
Đoàn xe diễu hành Trạm Trạm
Gồm 10 chiếc Dịch vụ Dịch vụ

 Giả sử bây giờ xe lan truyền với tốc độ 1000 km/h


 Và trạm tốn 1 phút để làm dịch vụ cho 1 xe
 Hỏi: Sẽ có những xe tới trạm th 2 tr ớc khi tất cả các
xe qua trạm th 1?
 Trả lời: Vâng, Sau 7 phút, xe đầu tiên tới trạm th 2
trong khi còn 3 xe khác đang ở trạm th 1.
 Bit đầu tiên c a gói có thể tới router tiếp theo tr ớc
khi toàn bộ gói đ ợc truyền đi tại router tr ớc!

Giới thiệu 1-95


Caravan analogy (more)
100 km 100 km
ten-car toll toll
caravan booth booth

 suppose cars now propagate at 1000 km/hr


 and suppose toll booth now takes one min to service a car
 Q: Will cars arrive to 2nd booth before all cars serviced at first
booth?
 A: Yes! after 7 min, 1st car arrives at second booth; three
cars still at 1st booth.

Giới thiệu 1-96


Trễ xếp hàng (nhắc lại)

average queueing
 R: băng thông liên kết (bps)

delay
 L: ộ dài gói (bits)
 a: tốc ộ ến trung bình
c a gói
traffic intensity
= La/R
 La/R ~ 0: trễ xếp hàng trung bình bé La/R ~ 0

 La/R -> 1: trễ xếp hàng trung bình lớn


 La/R > 1: trễ xếp hàng trung bình vô hạn!

La/R -> 1
Giới thiệu 1-97
Queueing delay (revisited)

average queueing
 R: link bandwidth (bps)

delay
 L: packet length (bits)
 a: average packet arrival
rate
traffic intensity
= La/R
 La/R ~ 0: avg. queueing delay small La/R ~ 0

 La/R -> 1: avg. queueing delay large


 La/R > 1: more work arriving
than can be serviced, average delay infinite!

* Check out the Java applet for an interactive animation on queuing and loss La/R -> 1
Giới thiệu 1-98
Trễ Internet thực tế và ường i
 Trên thực tế thì độ trễ Internet và mất gói
nh thế nào ?
 Ch ơng trình traceroute : đo độ trễ từ nguồn
đến các router dọc trên đ ờng đi c a gói đến
đích. Với mọi i:
 Gửi 3 gói đến router i trên đ ờng đi đến đích
 router i sẽ trả về 3 gói cho ng ời gửi
 Ng ời gửi tính thời gian từ lúc gửi gói đi tới lúc
nhận đ ợc phản hồi
 .
3 probes 3 probes

3 probes

Giới thiệu 1-99


Real Internet delays and routes
 what do real Internet delay & loss look like?
 traceroute program: provides delay
measurement from source to router along end-
end Internet path towards destination. For all i:
 sends three packets that will reach router i on path
towards destination
 router i will return packets to sender
 sender times interval between transmission and reply.

3 probes 3 probes

3 probes

Introduction 1-100
Trễ Internet thực tế và ường i
traceroute: gaia.cs.umass.edu to www.eurecom.fr
3 delay measurements from
gaia.cs.umass.edu to cs-gw.cs.umass.edu
1 cs-gw (128.119.240.254) 1 ms 1 ms 2 ms
2 border1-rt-fa5-1-0.gw.umass.edu (128.119.3.145) 1 ms 1 ms 2 ms
3 cht-vbns.gw.umass.edu (128.119.3.130) 6 ms 5 ms 5 ms
4 jn1-at1-0-0-19.wor.vbns.net (204.147.132.129) 16 ms 11 ms 13 ms
5 jn1-so7-0-0-0.wae.vbns.net (204.147.136.136) 21 ms 18 ms 18 ms
6 abilene-vbns.abilene.ucaid.edu (198.32.11.9) 22 ms 18 ms 22 ms
7 nycm-wash.abilene.ucaid.edu (198.32.8.46) 22 ms 22 ms 22 ms trans-oceanic
8 62.40.103.253 (62.40.103.253) 104 ms 109 ms 106 ms
9 de2-1.de1.de.geant.net (62.40.96.129) 109 ms 102 ms 104 ms link
10 de.fr1.fr.geant.net (62.40.96.50) 113 ms 121 ms 114 ms
11 renater-gw.fr1.fr.geant.net (62.40.103.54) 112 ms 114 ms 112 ms
12 nio-n2.cssi.renater.fr (193.51.206.13) 111 ms 114 ms 116 ms
13 nice.cssi.renater.fr (195.220.98.102) 123 ms 125 ms 124 ms
14 r3t2-nice.cssi.renater.fr (195.220.98.110) 126 ms 126 ms 124 ms
15 eurecom-valbonne.r3t2.ft.net (193.48.50.54) 135 ms 128 ms 133 ms
16 194.214.211.25 (194.214.211.25) 126 ms 128 ms 126 ms
17 * * *
18 * * * * means no response (probe lost, router not replying)
19 fantasia.eurecom.fr (193.55.113.142) 132 ms 128 ms 136 ms

Giới thiệu 1-101


Real Internet delays, routes
traceroute: gaia.cs.umass.edu to www.eurecom.fr
3 delay measurements from
gaia.cs.umass.edu to cs-gw.cs.umass.edu
1 cs-gw (128.119.240.254) 1 ms 1 ms 2 ms
2 border1-rt-fa5-1-0.gw.umass.edu (128.119.3.145) 1 ms 1 ms 2 ms
3 cht-vbns.gw.umass.edu (128.119.3.130) 6 ms 5 ms 5 ms
4 jn1-at1-0-0-19.wor.vbns.net (204.147.132.129) 16 ms 11 ms 13 ms
5 jn1-so7-0-0-0.wae.vbns.net (204.147.136.136) 21 ms 18 ms 18 ms
6 abilene-vbns.abilene.ucaid.edu (198.32.11.9) 22 ms 18 ms 22 ms
7 nycm-wash.abilene.ucaid.edu (198.32.8.46) 22 ms 22 ms 22 ms trans-oceanic
8 62.40.103.253 (62.40.103.253) 104 ms 109 ms 106 ms
9 de2-1.de1.de.geant.net (62.40.96.129) 109 ms 102 ms 104 ms link
10 de.fr1.fr.geant.net (62.40.96.50) 113 ms 121 ms 114 ms
11 renater-gw.fr1.fr.geant.net (62.40.103.54) 112 ms 114 ms 112 ms
12 nio-n2.cssi.renater.fr (193.51.206.13) 111 ms 114 ms 116 ms
13 nice.cssi.renater.fr (195.220.98.102) 123 ms 125 ms 124 ms
14 r3t2-nice.cssi.renater.fr (195.220.98.110) 126 ms 126 ms 124 ms
15 eurecom-valbonne.r3t2.ft.net (193.48.50.54) 135 ms 128 ms 133 ms
16 194.214.211.25 (194.214.211.25) 126 ms 128 ms 126 ms
17 * * *
18 * * * * means no response (probe lost, router not replying)
19 fantasia.eurecom.fr (193.55.113.142) 132 ms 128 ms 136 ms

* Do some traceroutes from exotic countries at www.traceroute.org


Giới thiệu 1-102
Mất gói
 Hàng đợi (còn gọi là bộ đệm) trong router có
dung l ợng hữu hạn
 Một gói đi đến khi hàng đợi đầy sẽ bị rớt (còn gọi
là mất gói)
 Gói bị mất có thể đ ợc phát lại bởi nút tr ớc đó,
bởi hệ thống đầu cuối nguồn hoặc không.
buffer
(waiting area) packet being transmitted
A

B
packet arriving to
full buffer is lost

Giới thiệu 1-103


Packet loss
 queue (aka buffer) preceding link in buffer has finite
capacity
 packet arriving to full queue dropped (aka lost)
 lost packet may be retransmitted by previous node,
by source end system, or not at all

buffer
(waiting area) packet being transmitted
A

B
packet arriving to
full buffer is lost
* Check out the Java applet for an interactive animation on queuing and loss Giới thiệu 1-104
Thông l ợng
 Thông l ợng: tốc độ (bit/đơn vị thời gian)
truyền bit giữa bên phát và bên thu
 T c thời: tốc độ tại một thời điểm nhất định
 Trung bình: tốc độ trong một khoảng thời gian dài

server,
server withbits
sends linkpipe
capacity
that can carry linkpipe
capacity
that can carry
file of into
(fluid) F bitspipe Rs bits/sec
fluid at rate Rc bits/sec
fluid at rate
to send to client Rs bits/sec) Rc bits/sec)

Giới thiệu 1-105


Throughput
 throughput: rate (bits/time unit) at which bits
transferred between sender/receiver
 instantaneous: rate at given point in time
 average: rate over longer period of time

server,
server withbits
sends linkpipe
capacity
that can carry linkpipe
capacity
that can carry
file of into
(fluid) F bitspipe Rs bits/sec
fluid at rate Rc bits/sec
fluid at rate
to send to client Rs bits/sec) Rc bits/sec)

Giới thiệu 1-106


Thông l ợng (tt)
 Rs < Rc Thông lượng đầu cuối-đầu cuối là bao nhiêu?

Rs bits/sec Rc bits/sec

 Rs > Rc Thông lượng đầu cuối-đầu cuối là bao nhiêu?

Rs bits/sec Rc bits/sec

Liên kết thắt cổ chai


Liên kết làm hạn chế thông l ợng đầu cuối-đầu cuối
Giới thiệu 1-107
Throughput (more)
 Rs < Rc What is average end-end throughput?

Rs bits/sec Rc bits/sec

 Rs > Rc What is average end-end throughput?

Rs bits/sec Rc bits/sec

bottleneck link
link on end-end path that constrains end-end throughput
Giới thiệu 1-108
Thông l ợng: trong Internet

 Thông l ợng đầu


cuối-đầu cuối c a Rs
mỗi kết nối: Rs Rs
min(Rc,Rs,R/10)
 Thực tế: Rc hoặc Rs
R
th ờng là thắt cổ
chai Rc Rc

Rc

10 kết nối chia sẻ băng thông c a liên


kết xương sống R bits/sec
Giới thiệu 1-109
Throughput: Internet scenario

 per-connection end-
end throughput: Rs
min(Rc,Rs,R/10) Rs Rs
 in practice: Rc or Rs
is often bottleneck
R

Rc Rc

Rc

10 connections (fairly) share


backbone bottleneck link R bits/sec
Giới thiệu 1-110
Ch ơng 1:
1.1 Internet là gì?
1.2 Biên mạng
 Hệ thống đầu cuối, các mạng truy cập, liên kết
mạng
1.3 Lõi mạng
 Chuyển mạch gói, chuyển mạch kênh, cấu trúc
mạng
1.4 Trễ, mất gói, thông l ợng
1.5 Các lớp giao th c, các mô hình dịch vụ
1.6 Tấn công mạng: An ninh mạng
1.7 Lịch sử
Giới thiệu 1-111
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
 end systems, access networks, links
1.3 network core
 packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Giới thiệu 1-112


Các lớp giao th c
Mạng là rất ph c tạp
với nhiều th :
 Hệ thống đầu
cuối Hỏi:
 router Có hy vọng gì về một
cấu trúc mạng có tổ
 Các loại liên kết ch c?
 ng dụng
 Giao th c …. or at least our
 Phần c ng, discussion of
phần mềm networks?

Giới thiệu 1-113


Protocol layers
Networks are complex,
with many pieces :
 hosts Question:
 routers is there any hope of
 links of various organizing structure of
media network?
 applications
 protocols …. or at least our
 hardware, discussion of networks?
software

Giới thiệu 1-114


Tổ ch c c a vận chuyển đ ờng không

vé (mua) vé (phản hồi)

hành lý (kiểm tra) hành lý (nhận)

cổng (vào) cổng (ra)

đường băng (cất cánh) đường băng (hạ cánh)

định tuyến bay định tuyến bay


Định tuyến bay

 Một chuỗi các b ớc

Giới thiệu 1-115


Organization of air travel
ticket (purchase) ticket (complain)

baggage (check) baggage (claim)

gates (load) gates (unload)

runway takeoff runway landing

airplane routing airplane routing


airplane routing

 a series of steps

Giới thiệu 1-116


Phân lớp ch c năng đ ờng không

vé (mua) vé (phản hồi) ticket

hành lý (kiểm tra) Hành lý (nhận) baggage

cổng (vào) cổng (ra) gate

đ/băng (cất cánh) đ/ băng (hạ cánh) takeoff/landing

định tuyến bay airplane routing airplane routing định tuyến bay airplane routing

Sân bay đi các trạm điều khiển Sân bay đến


không lưu trung gian

Các lớp: mỗi lớp thực hiện một dịch vụ


 Thông qua các hoạt động bên trong lớp đó
 Nhờ vào dịch vụ c a lớp d ới

Giới thiệu 1-117


Layering of airline functionality

ticket (purchase) ticket (complain) ticket

baggage (check) baggage (claim baggage

gates (load) gates (unload) gate

runway (takeoff) runway (land) takeoff/landing

airplane routing airplane routing airplane routing airplane routing airplane routing

departure intermediate air-traffic arrival


airport control centers airport

layers: each layer implements a service


 via its own internal-layer actions
 relying on services provided by layer below

Introduction 1-118
Vì sao phải phân lớp?
Việc xử lý các hệ thống ph c tạp cần:
 Một cấu trúc rõ ràng cho phép nhận dạng các
thành phần, mối liên hệ giữa các thành phần
c a một hệ thống ph c tạp.
 mô hình tham chiếu phân lớp dùng cho lập luận
 Mô đun hóa sẽ giúp việc bảo d ỡng, cập nhật
hệ thống dễ dàng
 Thay đổi cách thực hiện dịch vụ c a một lớp
không ảnh h ởng đến các lớp khác
 Phân lớp có gì không tốt?

Giới thiệu 1-119


Why layering?
dealing with complex systems:
 explicit structure allows identification,
relationship of complex system’s pieces
 layered reference model for discussion
 modularization eases maintenance, updating of
system
 change of implementation of layer’s service
transparent to rest of system
 e.g., change in gate procedure doesn’t affect rest of
system
 layering considered harmful?

Giới thiệu 1-120


Chồng giao th c Internet
 ng dụng: hỗ trợ các ng dụng
mạng
 FTP, SMTP, HTTP ng dụng
 Truyền tải: truyền dữ liệu từ tiến
trình đến tiến trình Truyền tải
 TCP, UDP
Mạng
 Mạng: định tuyến từ nguồn đến đích
cho các datagram
Liên kết
 IP, routing protocols
 Liên kết: truyền dữ liệu giữa các Vật lý
phần tử mạng kề cận
 Ethernet, 802.111 (WiFi), PPP
 Vật lý: truyền các bit “trên dây dẫn
Giới thiệu 1-121
Internet protocol stack
 application: supporting network
applications
 FTP, SMTP, HTTP application
 transport: process-process data
transfer transport
 TCP, UDP
network
 network: routing of datagrams
from source to destination
link
 IP, routing protocols
 link: data transfer between physical
neighboring network elements
 Ethernet, 802.111 (WiFi), PPP
 physical: bits on the wire
Giới thiệu 1-122
Mô hình tham chiếu ISO/OSI

 Trình bày: cho phép các ng


dụng phiên dịch ý nghĩa c a ng dụng
dữ liệu, vd, mật mã hóa, nén
Trình bày
 Phiên: đồng bộ, kiểm tra,
phục hồi việc trao đổi dữ liệu Phiên
 Chồng giao th c Internet Truyền tải
thiếu các lớp này Mạng
 Các dịch vụ này nếu cần thì
phải thực hiện ở lớp ng dụng Liên kết
 Có cần không? Vật lý

Giới thiệu 1-123


ISO/OSI reference model
 presentation: allow applications
to interpret meaning of data, application
e.g., encryption, compression,
machine-specific conventions presentation
 session: synchronization, session
checkpointing, recovery of data transport
exchange
network
 Internet stack missing these
layers! link
 these services, if needed, must be physical
implemented in application
 needed?

Giới thiệu 1-124


message M
Nguồn
application
Đóng gói
segment Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical
link
physical

switch

Đích Hn Ht M network
M application Hl Hn Ht M link Hn Ht M
Ht M transport physical
Hn Ht M network
Hl Hn Ht M link router
physical

Giới thiệu 1-125


source
message M application
Encapsulation
segment Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical
link
physical

switch

destination Hn Ht M network
M application Hl Hn Ht M link Hn Ht M
Ht M transport physical
Hn Ht M network
Hl Hn Ht M link router
physical

Giới thiệu 1-126


Ch ơng 1:
1.1 Internet là gì?
1.2 Biên mạng
 Hệ thống đầu cuối, các mạng truy cập, liên kết
mạng
1.3 Lõi mạng
 Chuyển mạch gói, chuyển mạch kênh, cấu trúc
mạng
1.4 Trễ, mất gói, thông l ợng
1.5 Các lớp giao th c, các mô hình dịch vụ
1.6 Tấn công mạng: An ninh mạng
1.7 Lịch sử
Giới thiệu 1-127
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
 end systems, access networks, links
1.3 network core
 packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Giới thiệu 1-128


An ninh mạng
 An ninh mạng quan tâm:
 Những kẻ xấu có thể tấn công mạng nh thế nào?
 Làm sao có thể phòng th mạng tr ớc những tấn
công đó?
 Thiết kế kiến trúc mạng miễn nhiễm với tấn công
nh thế nào?
 Thiết kế ban đầu c a Internet không quan tâm
(nhiều) đến vấn đề an ninh
 Tầm nhìn ban đầu: “một nhóm các ng ời dùng tin
cậy lẫn nhau kết nối vào một mạng trong suốt” 
 Các nhà thiết kế giao th c Internet đang chơi trò
“đuổi bắt”
 Vấn đề an ninh đ ợc xem xét ở tất cả các lớp
Giới thiệu 1-129
Network security
 field of network security:
 how bad guys can attack computer networks
 how we can defend networks against attacks
 how to design architectures that are immune to
attacks
 Internet not originally designed with (much)
security in mind
 original vision: a group of mutually trusting users
attached to a transparent network 
 Internet protocol designers playing catch-up
 security considerations in all layers!

Giới thiệu 1-130


Kẻ xấu: cài mã độc vào hệ thống đầu cuối thông qua Internet

 Mã độc có thể đi vào hệ thống đầu cuối từ:


 virus: tự lây nhiễm khi nhận/thực hiện các đối t ợng (vd,
file gửi kèm e-mail)
 Worm: tự lây nhiễm khi nhận các đối t ợng có khả năng tự
kích hoạt
 Mã độc do thám (spyware) có thể ghi lại việc gõ
phím, các website đã vào, rồi gửi thông tin đến một
site tập hợp.
 Hệ thống đầu cuối bị nhiễm có thể bị dính vào một
mạng ma (botnet), sử dụng cho việc phát tán th
rác (spam)và tấn công từ chối dịch vụ (DDoS)

Giới thiệu 1-131


Bad guys: put malware into hosts via Internet
 malware can get in host from:
 virus: self-replicating infection by receiving/executing
object (e.g., e-mail attachment)
 worm: self-replicating infection by passively receiving
object that gets itself executed
 spyware malware can record keystrokes, web
sites visited, upload info to collection site
 infected host can be enrolled in botnet, used for
spam. DDoS attacks

Giới thiệu 1-132


Kẻ xấu: tấn công server, hạ tầng mạng
Từ chối dịch vụ (DoS): kẻ tấn công khiến cho tài
nguyên (server, băng thông) không còn cho các truy
cập hợp pháp bằng cách chiếm dụng tài nguyên bằng
nhiều truy cập giả
1. Chọn mục tiêu tấn công

2. Chiếm quyền c a nhiều máy


tính trên mạng (botnet)
3. Gửi các gói tới mục tiêu từ
Mục tiêu
các máy đã bị chiếm
quyền

Giới thiệu 1-133


Bad guys: attack server, network infrastructure
Denial of Service (DoS): attackers make resources
(server, bandwidth) unavailable to legitimate traffic
by overwhelming resource with bogus traffic

1. select target
2. break into hosts around
the network (see botnet)
3. send packets to target from
compromised hosts
target

Giới thiệu 1-134


Kẻ xấu có thể nhìn trộm các gói
nhìn trộm gói:
 Môi tr ờng quảng bá (Ethernet, không dây)
 Giao tiếp mạng đọc/ghi lại tất cả các gói (vd. cả mật
khẩu!) chuyển ngang qua nó

A C

src:B dest:A payload


B

Giới thiệu 1-135


Bad guys can sniff packets
packet sniffing :
 broadcast media (shared ethernet, wireless)
 promiscuous network interface reads/records all packets
(e.g., including passwords!) passing by

A C

src:B dest:A payload


B

 wireshark software used for end-of-chapter labs is a


(free) packet-sniffer
Giới thiệu 1-136
Kẻ xấu có thể dùng địa chỉ giả mạo

Đánh lừa IP : gửi các gói với địa chỉ nguồn giả
mạo
A C

src:B dest:A payload

Giới thiệu 1-137


Bad guys can use fake addresses
IP spoofing: send packet with false source address
A C

src:B dest:A payload

… lots more on security (throughout, Chapter 8)

Giới thiệu 1-138


Ch ơng 1:
1.1 Internet là gì?
1.2 Biên mạng
 Hệ thống đầu cuối, các mạng truy cập, liên kết
mạng
1.3 Lõi mạng
 Chuyển mạch gói, chuyển mạch kênh, cấu trúc
mạng
1.4 Trễ, mất gói, thông l ợng
1.5 Các lớp giao th c, các mô hình dịch vụ
1.6 Tấn công mạng: An ninh mạng
1.7 Lịch sử
Giới thiệu 1-139
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
 end systems, access networks, links
1.3 network core
 packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history

Giới thiệu 1-140


Lịch sử c a Internet
1961-1972: Nguyên lý chuyển mạch gói ban sơ
 1961: Kleinrock – lý  1972:
thuyết hàng đợi cho  ARPAnet trình diễn công khai
thấy hiệu quả c a  NCP (Network Control
chuyển mạch gói Protocol) giao th c đầu cuối-
 1964: Baran – chuyển đầu cuối đầu tiên
mạch gói trong các  Ch ơng trình e-mail đầu tiên
mạng quân sự
 ARPAnet có 15 nút mạng
 1967: ARPAnet đ ợc
thai nghén từ Cơ quan
quản lý các dự án
nghiên c u cao cấp
(Advanced Research
Projects Agency - USA)
 1969: nút ARPAnet đầu
tiên đi vào hoạt động
Giới thiệu 1-141
Internet history
1961-1972: Early packet-switching principles
 1961: Kleinrock -  1972:
queueing theory shows  ARPAnet public demo
effectiveness of packet-  NCP (Network Control
switching Protocol) first host-host
 1964: Baran - packet- protocol
switching in military nets  first e-mail program
 1967: ARPAnet  ARPAnet has 15 nodes
conceived by Advanced
Research Projects
Agency
 1969: first ARPAnet
node operational

Giới thiệu 1-142


Lịch sử c a Internet
1972-1980: Liên mạng, các mạng mới và độc quyền
 1970: Mạng vệ tinh ALOHAnet
ở Hawaii Nguyên lý liên mạng
 1974: Cerf và Kahn – kiến trúc c a Cerf và Kahn:
liên mạng (kết nối các mạng)  Tối giản, tự trị - không cần
thay đổi bên trong để kết nối
 1976: Ethernet ở Xerox PARC các mạng
 Cuối 70’s: các kiến trúc độc  Mô hình dịch vụ nổ lực hết
quyền: DECnet, SNA, XNA s c
 Các router không trạng thái
 Cuối 70’s: chuyển mạch gói  Điều khiển phân tán
với độ dài cố định (tiền thân
c a ATM) định hình cho kiến trúc c a
Internet hiện nay
 1979: ARPAnet có 200 nút

Giới thiệu 1-143


Internet history
1972-1980: Internetworking, new and proprietary nets
 1970: ALOHAnet satellite
network in Hawaii Cerf and Kahn’s
 1974: Cerf and Kahn - internetworking principles:
architecture for interconnecting  minimalism, autonomy - no
networks internal changes required to
 1976: Ethernet at Xerox PARC interconnect networks
 best effort service model
 late70’s: proprietary
architectures: DECnet, SNA,  stateless routers
XNA  decentralized control
 late 70’s: switching fixed length define today’s Internet
packets (ATM precursor) architecture
 1979: ARPAnet has 200 nodes

Giới thiệu 1-144


Lịch sử c a Internet
1980-1990: các giao th c mới, sự nở rộ các mạng
 1983: triển khai TCP/IP  Các mạng quốc gia mới:
 1982: giao th c email Csnet, BITnet, NSFnet,
SMTP đ ợc định nghĩa Minitel
 1983: DNS định nghĩa  100,000 hệ thống đầu
việc chuyển đổi tên cuối đ ợc kết nối mạng
miền– địa chỉ IP
 1985: giao th c FTP
đ ợc định nghĩa
 1988: kiểm soát tắc
nghẽn c a TCP

Giới thiệu 1-145


Internet history
1980-1990: new protocols, a proliferation of networks
 1983: deployment of  new national networks:
TCP/IP Csnet, BITnet, NSFnet,
 1982: smtp e-mail Minitel
protocol defined  100,000 hosts connected
 1983: DNS defined for to confederation of
name-to-IP-address networks
translation
 1985: ftp protocol defined
 1988: TCP congestion
control

Giới thiệu 1-146


Lịch sử c a Internet
1990, 2000’s: th ơng mại hóa, Web, các ng dụng mới
 Đầu 1990’s: ARPAnet giải thể Cuối 1990’s – 2000’s:
 1991: NSF hạn chế việc sử  Nhiều ng dụng chết
dụng NSFnet cho mục đích ng ời: tin nhắn t c thì,
th ơng mại (giải thể, 1995) chia xẻ file P2P
 Đầu 1990s: Web  An ninh mạng đ ợc quan
 hypertext [Bush 1945, tâm
Nelson 1960’s]  ớc tính có 50 triệu hệ
 HTML, HTTP: Berners-Lee thống đầu cuối, hơn 100
 1994: Mosaic, sau này là triệu ng ời dùng
Netscape  Liên kết x ơng sống
 Cuối 1990’s: th ơng mại chạy với tốc độ Gbps
hóa web

Giới thiệu 1-147


Internet history
1990, 2000’s: commercialization, the Web, new apps
 early 1990’s: ARPAnet late 1990’s – 2000’s:
decommissioned  more killer apps: instant
 1991: NSF lifts restrictions on messaging, P2P file sharing
commercial use of NSFnet  network security to
(decommissioned, 1995) forefront
 early 1990s: Web  est. 50 million host, 100
 hypertext [Bush 1945, million+ users
Nelson 1960’s]  backbone links running at
 HTML, HTTP: Berners-Lee Gbps
 1994: Mosaic, later Netscape
 late 1990’s:
commercialization of the Web

Giới thiệu 1-148


Lịch sử c a Internet
2005- nay
 ~750 triệu hệ thống đầu cuối
 Điện thoại thông minh (Smartphone )và máy tính bảng
 Triển khai rầm rộ việc truy cập băng rộng
 Truy cập không dây tốc độ cao có mặt khắp nơi
 Xuất hiện các mạng xã hội trực tuyến:
 Facebook: ngay lập t c có cả tỷ ng ời dùng
 Các nhà cung cấp dịch vụ (Google, Microsoft) tạo
ra các mạng c a riêng họ
 Bỏ qua Internet, cung cấp truy cập t c thì
email, tìm kiếm,...
 Th ơng mại điện tử, các tr ờng đại học, công sở
chạy các dịch vụ c a họ trên đám mây (vd,
Amazon EC2)
Giới thiệu 1-149
Internet history
2005-present
 ~750 million hosts
 Smartphones and tablets
 Aggressive deployment of broadband access
 Increasing ubiquity of high-speed wireless access
 Emergence of online social networks:
 Facebook: soon one billion users
 Service providers (Google, Microsoft) create their own
networks
 Bypass Internet, providing instantaneous access
to search, emai, etc.
 E-commerce, universities, enterprises running their
services in cloud (eg, Amazon EC2)

Giới thiệu 1-150


Tóm tắt ch ơng 1
Chúng ta đã bao quát
cả núi tài liệu! Giờ thì chúng ta đã
 Internet là gì? có đ ợc:
 Giao th c là gì?  Bối cảnh, tổng quan về
 Biên mạng, Lõi mạng, Mạng việc nối mạng
truy cập  Trên cơ sở này, sẽ tiếp
 Chuyển mạch gói s/v tục tìm hiểu sâu và chi
chuyển mạch kênh tiết hơn (ở các ch ơng
 Cấu trúc c a Internet tiếp theo)
 Hiệu suất: mất gói, trễ,
thông l ợng
 Phân lớp, các mô hình dịch
vụ
 An ninh mạng
 Lịch sử c a Internet
Giới thiệu 1-151
Introduction: summary
covered a ton of material! you now have:
 Internet overview  context, overview, feel
 what’s a protocol? of networking
 network edge, core, access  more depth, detail to
network follow!
 packet-switching versus
circuit-switching
 Internet structure
 performance: loss, delay,
throughput
 layering, service models
 security
 history

Giới thiệu 1-152

You might also like