UNIT 5. Instruction to Computer Networks

Download Report

Transcript UNIT 5. Instruction to Computer Networks

Feng Lin
Sichuan Univ.






Layered Reference Model
Data Transfer in Layered Model
Network Devices
TCP & UDP
More on IP
Link Layer Tech.


Networks are complex!!
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

Internet protocol stack

ISO/OSI reference model

Application layer: supporting network applications
◦ POP, SMTP, HTTP

Transport layer: process-process data transfer
◦ TCP, UDP

Network layer: routing of datagrams from source to
destination
◦ IP, routing protocols

Link layer: data transfer between neighboring network
elements
◦ PPP, Ethernet

Physical layer: bits “on the wire”

A layer N+1 entity sees the lower layers only as a
service provider

The unit of data send between peer entities is called a
Protocol Data Unit (PDU,协议数据单元 )
A

N Layer
Entity
PDU
(at layer N)
N Layer
Entity
B
Scenario: Layer-N at A sends a layer-N PDU to layer-N
at B
8

As data is moving down the protocol stack, each
protocol is adding layer-specific control information
User data
HTTP
HTTP Header
User data
TCP Header HTTP Header
User data
TCP
IP
TCP segment
IP Header
Ethernet
TCP Header HTTP Header
User data
IP datagram
Ethernet
Header
IP Header
TCP Header HTTP Header
User data
Ethernet frame
9
Ethernet
Trailer
HTTP
HTTP protocol
HTTP
TCP
TCP protocol
TCP
IP
Ethernet
IP
IP protocol
Ethernet
argon.tcpiplab.edu
128.143.137.144
Ethernet
IP
IP protocol
Ethernet
Ethernet
Ethernet
router71.tcpip- router137.tcpiplab.edu
lab.edu
128.143.137.1
128.143.71.1
00:e0:f9:23:a8:20
neon.tcpip-lab.edu
128.143.71.21
10
HTTP
TCP
IP
Frame is an IP
datagram
Ethernet
Send HTTP Request
to neon
HTTP
Establish a connection to
Open TCPatconnection
128.143.71.21
port 80 to
TCP
128.143.71.21 port 80
IP datagram is a TCP
segment for port 80
Send
IP data-gram
Send a datagram (which
contains
a
Send IP datagram
to
IP to
IP
to128.143.71.21
128.143.71.21
connection request)
128.143.71.21
Frame is an IP
datagram Send the
Send the datagram to 128.143.137.1
Ethernet
Ethernet
Ethernet
datagram
to 128.143.7.21
argon.tcpipneon.tcpip-lab.edu
router71.tcpip- router137.tcpipSend Ethernet frame
Send Ethernet frame
lab.edu
128.143.71.21
lab.edu
lab.edu
to
to
128.143.137.144
128.143.137.1
128.143.71.1
00:20:af:03:98:28
00:e0:f9:23:a8:20
00:e0:f9:23:a8:20
11


Network devices are components used to connect
computers or other electronic devices together
Besides the various modems for connecting into
Internet, the following devices are most commonly
used.
◦
◦
◦
◦
NIC( Network Interface Card)
Hub
Switch
Router


NIC is a hardware card installed in a computer so it can
communicate on a network
Layer 1 & Layer 2




A hub is a device that connects several nodes of a LAN
A repeater amplifies and regenerates signals so they
can retain the strength to reach their destinations
Hub is basically a multiport repeater.
Layer 1 device


Switches are a special type of hub that offers an
additional layer of intelligence to basic, physical-layer
repeater hubs.
Layer 2 device



A router is a device that is connected to at least two
networks and makes decisions about the best route for
data
In general, a router stores a routing table which is
generated by routing algorithm. When pkts arrive, the
router will forward pkts by routing table.
Working on Layer 3

Port number—the id of network process
◦ Example port numbers:
 HTTP server: 80
 Mail server: 25

Two type of transport services provided by Internet
◦ Connectionless transport service—UDP (User Datagram
Protocol)
 Unreliable data transfer
 Simple, high transfer speed
◦ Connection-Oriented transport service—TCP(Transmission
Control Protocol)
 Reliable data transfer
Application
e-mail
remote terminal access
Web
file transfer
streaming multimedia
Internet telephony
Application
layer protocol
Underlying
transport protocol
SMTP
Telnet
HTTP
FTP
HTTP (eg Youtube),
RTP
SIP, RTP, proprietary
(e.g., Skype)
TCP
TCP
TCP
TCP
TCP or UDP
typically UDP
Application Layer
218


Internet Protocol (IP协议) :One of the most important
protocols
Uses connectionless(无连接) delivery – it does not
guarantee delivery

Each packet that travels through the Internet is treated
as an independent unit of data without any relation to
any other unit of data.
20



IP Address (IP地址): An identifier for a computer or device on a
TCP/IP network.
The format of an IP address version 4 is a 32-bit numeric address written as
four numbers separated by periods (点分十进制表示法). Each number can
be zero to 255.
For example:
10000001 00001011 00000011 00011111
129
11
3
IP=129.11.3.31

31
IP address consists of two parts
◦ The network portion is used to route packets between networks
◦ The host portion identifies the particular device on the host network



There are five classes of IP address
The class of address is identified by the first bits of the
address
Three classes are used for networks. The last two are
reserved for special purposes (Class D is for multicast,
and Class E is for experimentation and future use)
Byte 1
Byte 2
Byte 3
Byte 4
Class A
0 Network
Host
Class B
10 Network
Host
Class C
110 Network
Host
Class A – First eight bits identify network, the first bit is fixed at 0, giving
27 (128) networks, and 224 (16,777,316) hosts
Class B – First 16 bits identify network, the first two bits are fixed at 10,
giving 214 (16,384) networks, and 216 (65,536) hosts
Class C – First 21 bits identify network, the first three bits are fixed at 110,
giving 221 (2,097,152) networks and 28 (256) hosts
23



For any organization the Network portion of the
address remains fixed, the network administrator can
assign the host address
Assignment can be manual or through Dynamic Host
Configuration
Dynamic Host Configuration Protocol (动态主机配置
协议)
◦ Internet protocol for automating the configuration of
computers that use TCP/IP.

Larger classes of networks (A and B) are usually
divided into smaller networks
◦ This is achieved by dividing up the host portion of the address
◦ This process is known as subnetting

A ‘subnet mask’ uses some of the bits from the host
address to create subnets
◦ The number of bits used determines the number of subnets
which are generated
◦ The remaining bits in the host portion identify the number of
host IP addresses in each subnet
 <network portion><subnet portion><host portion>
◦ For Example: IP Address: 218.194.22.96
Subnet mask: 255.255.255.224
25
26


ipconfig Configure the network parameters on localhost
Ping (Packet Internet Groper) – sends a signal to a
specific address and waits for a reply
◦ If it gets a response, Ping
 Reports computer is online
 Displays the elapsed time (latency) for the round-trip message

Traceroute – records a packet’s path from your
computer to its destination
◦ Hop跳数 is an intermediate connection in a string of
connections linking two network devices.
◦ Traceroute utilities to trace the hop



Using Ping or Traceroute, you can discover how long
data is in transit
On average, data within China usually arrives at its
destination 110-120 ms (milliseconds) after it is sent
Overseas transmission require a little more time
Collision: When two devices on a sharing
channel send packets at the same instant, it’s
called a collision.
 Network access method

◦ determined by type of network interface card and cables
◦ Ethernet
◦ Token Ring
 Ethernet
以太网: IEEE 802.3
◦ The most popular LAN tech.
◦ Uses Bus or Star Topology
◦ Supports data transfer rate of 10/100/1000
Mbps
◦ Use CSMA/CD to avoid collision
31

Token ring 令牌环网: IEEE 802.5
◦ The second most popular network access
method
◦ transmits data at 4 or 16 megabits per second
over twisted-pair wire.
◦ uses ring topology
◦ uses token (special message) to prevent
collisions
32

Based on Ring Topology

Makes use of Tokens
◦ A token is a special series of bits that travels around a tokenring network.
◦ The token acts like a ticket, enabling its owner to send a
message across the network
33







Layered Reference Model
Network Devices
How data travels in the layered model
Difference between UDP and TCP
IP and IP address
Tools to check your network
Ethernet, Token Ring

what did you know?
◦ Fundamental concepts of Communication, Computer
Networks, and Internet

What don’t you know?
◦ How to work with computer networks
◦ How the computer networks work in detail
You can reveal questions above in the course, named computer
networks.