Upload
daquan-burch
View
28
Download
1
Embed Size (px)
DESCRIPTION
TCP/IP 통신망 특론. 2 장 Link Layer. 컴퓨터 네트워크 실험실 이희규. 목 차. 2.1 Introduction 2.2 Ethernet and IEEE 802 Encapsulation 2.3Trailer Encapsulation 2.4SLIP : Serial Line IP 2.5Compressed SLIP 2.6PPP : Point-to-Point Protocol 2.7Loopback Interface - PowerPoint PPT Presentation
Citation preview
Computer Network Lab.
TCP/IP TCP/IP 통신망 특론통신망 특론
컴퓨터 네트워크 실험실 이희규
2 장 Link Layer
2Computer Network Lab.
목 차2.1 Introduction
2.2 Ethernet and IEEE 802 Encapsulation
2.3 Trailer Encapsulation
2.4 SLIP : Serial Line IP
2.5 Compressed SLIP
2.6 PPP : Point-to-Point Protocol
2.7 Loopback Interface
2.8 MTU (maximum transmission unit)
2.9 Path MTU
2.10 Serial Line Throughput Calculations
2.11 요약
3Computer Network Lab.
2.1 Introduction
링크계층의 목적 IP module 을 위한 IP datagram 의 send/receive
ARP module 을 위한 ARP request 와 reply
RARP module 을 위한 RARP request 와 reply
TCP/IP 는 서로 다른 Link Layer 를 지원한다 즉 , TCP/IP 아키텍처는 어떤 종류의 물리적 네트워크
상에서도 수행할 수 있도록 설계되어 있다 .
Ethernet, token ring, FDDI, RS-232 serial line, etc.
4Computer Network Lab.
Ethernet 일반적으로 DEC, Intel, Xerox 사가 1982 년에
제안한 표준을 의미하며 CSMA/CD (Carrier Sense, Multiple Access with Collision Detection) 라고 하는 access method 를 사용
전송속도 10Mbps, 48-bit address
IEEE 802 위원회 802.2 LLC(Logical Link Control) 802.3 CSMA/CD 802.4 token bus 802.5 token ring
2.2 Ethernet and IEEE 802 Encapsulation
5Computer Network Lab.
IP datagram encapsulation define Ethernet 에 대한 RFC 894
IEEE 802 network 에 대한 RFC 1042
2.2 Ethernet and IEEE 802 Encapsulation (Cont’d)
6Computer Network Lab.
Host Requirement RFC RFC 894(Ethernet) encapsulation 을 사용하는 packet 을 송수신할 수
있어야 한다 RFC 894 packet 과 혼합된 RFC 1042(IEEE 802) packet 을 수신할 수
있어야 한다 RFC 1042 encapsulation 을 사용한 packet 을 송신할 수도 있어야
한다 . 호스트가 두 타입의 packet 을 송신할 수 있다면 송신한 packet 의 타입을 구성할 수 있어야 하고 구성 옵션은 RFC 894 를 따라야 한다 .
RFC 894 encapsulation 이 가장 일반적으로 사용되고 있다 .
2.2 Ethernet and IEEE 802 Encapsulation (Cont’d)
7Computer Network Lab.
6 6 2 1 1 1 3 2 38-1492 4
destaddr
lengDSAP
AASSAP
AAcntl03
org code00 type CRCdata
srcaddr
802.3 MAC 802.2 LLC 802.2 SNAP
IEEE 802.2/802.3 Encapsulation(RFC 1042)
2 38-1492
type0800
IP datagram
2 28
type0806
ARP request/reply
10
PAD
2 28
type0835
RARP request/reply
10
PAD
6 6 2 46-1500 4
destaddr
type CRCdatasrc
addr
EthernetEncapsulation(RFC 894) 46-1500 bytes
2 46-1500
type0800 IP datagram
2
type0806
28
ARP request/reply
18
PAD
28
RARP request/reply
18
PAD
2
type0835
IEEE 802.2/802.3 캡슐화 (RFC 1042) 와 이더넷 캡슐화 (RFC 894)
8Computer Network Lab.
RFC 893 은 trailer encapsulation 이라고 하는 또 다른
형태의 Ethernet encapsulation 을 설명
이것은 IP datagram 의 필드 순서를 바꿈으로서 성능
개선을 꾀한 실험에서 비롯되었음
즉 , IP 와 TCP header 를 data 부분의 끝으로
옮김으로써 data 가 kernel 내로 복사될 때 memory to
memory copy 가 효율적으로 이루어지도록 한 것임
현재는 사용되지 않음
2.3 Trailer Encapsulation
9Computer Network Lab.
RFC 1055 RS-232 serial port 를 통해 Internet 에 접속할 때 사용 framing rule
IP datagram 의 앞뒤에 special character END(0xc0) 를 추가 . 이는 어떤 line noise 가 데이터로 해석되는 것을 막기 위함 .
IP datagram 내에 0xc0 는 0xdb, 0xdc 로 변환하여 전송 (0xdb 는 SLIP ESC character 라 함 )
IP datagram 내에 0xdb 는 0xdb, 0xdd 로 변환하여 전송
ESCESC END
11
11111
END
1
c0
c0
c0
db
dcdb dddb
IP datagram
2.4 SLIP : Serial Line IP
10Computer Network Lab.
SLIP 의 단점 각 end system 은 서로의 IP address 를 알고 있어야 한다 . 즉 ,
IP address 를 알려 줄 방법이 없다 .
Ethernet 의 type field 와 유사한 type field 가 없다 . 어떤 seria
l line 이 SLIP 을 사용하고 있다면 동시에 다른 protocol 을 사용할 수 없다 .
SLIP 은 Ethernet 의 CRC 와 같은 아무런 checksum 을 하지 않는다 . SLIP 을 통해 전송하고 있는 datagram 은 잡음으로 인해 잘못될 수 있고 , 이는 상위 계층이 검출해야 한다 .
따라서 IP 의 header checksum, TCP 의 header 와 data checksu
m, UDP 의 header 와 data(optional) checksum 이 이를 담당한다 .
2.4 SLIP : Serial Line IP(Cont’d)
11Computer Network Lab.
RFC 1144 [Jacobson 1990a]
SLIP line 은 저속 (19200bits/sec or below) 이며 interactive traffic(TC
P 를 사용하는 Telnet or Rlogin) 에 빈번히 사용 : 1 byte 를
전송하기 위해 40bytes(TCP 20, IP20) 의 overhead 가 있음 .
이러한 성능상의 결점을 해결하기 위해 CSLIP 을 고안
일반적으로 어떤 접속에 사용되는 두 header 의 일부 field 는
바뀌지 않는다는 성질을 이용하여 40 bytes 의 header 를 3 or 5 byt
es 로 줄여서 전송 . 따라서 이러한 작은 header 는 interactive respo
nse time 을 많이 개선한다 .
2.5 Compressed SLIP
12Computer Network Lab.
PPP 는 SLIP 의 모든 단점을 수정하며 다음과 같은 3개의 요소로 구성된다 .
Serial link 상의 IP datagram 을 encapsulation 하는 방법 . PPP 는
8 bits data, no parity 를 사용하는 asynchronous link 와 bit-oriented sync
hronous link 를 모두 지원한다 .
Data-link connection 을 설정 , 구성 , 테스트 하기 위한 LCP(Li
nk Control Protocols). 따라서 각 end system 은 다양한 option 을
협상할 수 있다 .
NCP (Network Control Protocols) 로 다른 네트워크 계층의
프로토콜 지정 . 현재 IP, OSI network layer, DECnet, AppleTalk 를
위한 RFC 가 존재 .
2.6 PPP : Point-to-Point Protocol
13Computer Network Lab.
RFC 1331 : encapsulation method and link control protocol RFC 1332 : network control protocol for IP
12up to 1500 bytes2111
flag7E
addrFF
control03
protocol CRCflag7E
information
protocol0021
IP datagram
protocolC021
link control data
protocol8021
network control data
2.6 PPP : Point-to-Point Protocol(Cont’d)
14Computer Network Lab.
information field 에 0x7e 가 나타난 경우 동기식 링크인 경우 bit stuffing
비동기식 링크인 경우 escape character(0x7d) 사용하며 escape
character 가 PPP frame 에 나타난 경우 ( 두 번째 바이트의 6 번째 bit 를 보수로 바꿈 )
0x7e 는 0x7d, 0x5e
0x7d 는 0x7d, 0x5d
0x20 보다 작은 값은 무조건 투명유지 작업을 하게 된다 . 예를 들면 0x01 은 0x7d, 0x21 로 바꾸어 전송 . 이는 호스트나 모뎀상의 serial
driver 가 ASCII control character 로 인식하는 것을 막기 위함 .
2.6 PPP : Point-to-Point Protocol(Cont’d)
15Computer Network Lab.
SLIP 과 마찬가지로 constant(flag, address) 를 생략하고 protocol 을 1 byte 로 줄여 사용할 수 있다 . 그러나 이 경우에도 3 byte(CRC 2,
protocol 1) 의 overhead 가 생김 . 또한 CSLIP 과 마찬가지로 IP,
TCP header 의 크기를 줄여서 사용할 수 있다 .
SLIP 보다 PPP 가 주는 장점 한 serial line 에 multiple protocol 을 제공 각 frame 에 cyclic redundancy check
IP network control protocol 을 사용하여 IP address 의 동적 협상 가능 CSLIP 과 유사한 TCP, IP header compression
link control protocol 을 통한 다수의 data-link option 협상 결과적으로 이러한 이점은 3 byte 의 overhead, link 를 설정할 때 협상을 하기
위한 몇 개의 frame, 훨씬 더 복잡한 구현에 대한 대가이다 .
2.6 PPP : Point-to-Point Protocol(Cont’d)
16Computer Network Lab.
같은 호스트내의 client 와 server 가 TCP/IP 를 이용하여 통신하기 위해 대부분 loopback interface 를 제공
이름은 localhost, IP address 는 127.0.0.1
loopback driver
IP outputfunction
IP inputfunction
place on IPinput queue
destination IP addressequal broadcast address
or multicast address?
destination IP addressequal interface IP address?
place on IPinput queue
demultiplex based onEthernet frame type
ARP
yes
yes no
no, use ARP toget destinationEthernet address
ARP
Ethernet
send receive
IP
Ethernet driver
2.7 Loopback Interface
17Computer Network Lab.
Key points loopback address 로 보내진 모든 것은 IP input 에 나타난다 . broadcast or multicast address 로 보내진 datagram 은 loopback interfac
e 로 복사되고 Ethernet 으로 보내진다 . 이는 broadcasting 과 multicasting 의 정의가 sending host 를 포함하기 때문이다 .
자신의 IP address 중 하나로 보내진 어떤 것도 loopback interface 로 보내진다 .
모든 transport 와 IP layer 가 loopback data 를 처리하는 것이 비효율적으로 보일지도 모르겠지만 이는 network layer 에게 loopback interface 가 단지 다른 link layer 로 보이기 때문에 설계를 단순화 시킨다 .
또한 자신의 IP address 중 하나로 송신한 IP datagram 은 네트워크 상에 절대로 나타날 수가 없다는 것을 암시한다 .
2.7 Loopback Interface (cont’d)
18Computer Network Lab.
frame 의 크기를 제한하는 link layer 의 특성을 MTU (maximum transmission unit) 라 한다 .
IP datagram 이 link layer 의 MTU 보다 크면 fragmentation 이 일어나며 각 fragment 는 MTU 보다 작아야 한다 .
이 중 Point-to-Point 에 대한 MTU 는 network media 의 물리적 특성에 따른 것이 아니라 대화형 응용의 적당한 response 를 제공하기 위한 논리적인 제한 .
MTU(bytes)NetworkHyperchannel16 Mbits/sec token ring(IBM)
4 Mbits/sec token ring(IEEE 802.5)FDDIEthernetIEEE 802.3/802.2X.25Point-to-Point(low delay)
65535179144464435215001492576296
2.8 MTU
19Computer Network Lab.
두 호스트가 같은 network 상에서 통신할 때는 MTU 가 중요한 factor 이다 .
그러나 두 호스트 사이에 multiple network 가 개입되어 있는 경우 두 호스트가 접속한 network 의 MTU 보다는 중계 network 의 가장 작은 MTU 가 더 중요하며 이를 path MTU 라 한다 .
Path MTU 는 일정하지 않으며 이는 어떤 시점에 사용된 경로에 의존하기 때문이다 .
또한 routing 은 대칭이 아니다 . 즉 , A 에서 B 로 가는 경로와 B 에서 A 로 가는 경로가 다를 수 있기 때문이다 . 따라서 path MTU 는 두 방향이 서로 다를 수 있다 .
RFC 1191 에는 path MTU 를 결정하기 위한 방법 (path MTU discovery
mechanism) 을 설명하고 있다 .
2.9 Path MTU
20Computer Network Lab.
line speed 9600bps, data 8 bits, start 1 bit, stop 1bit 인 경우 960 byte/sec 이며 1024 byte packet 전송에 1066ms 가 소요된다 .
이러한 가정하에 SLIP link 상에서 1024 byte frame 을 나르는 application 과 interactive application 이 사용되는 경우 interactive
packet 을 보내는데 평균 1066/2 = 533ms 를 기다려야 한다 .
Interactive traffic 은 100-200ms 를 넘어서면 좋지 않은 것으로 판단한다 [Jacobson 1990a]( 인간 공학 연구 )
MTU 가 256 인 경우 266ms(256/960) 소요되며 평균 wait는 133ms 이다 . 133 이 완벽한 throughput 은 아니나 64 나 128 보다는 utilization 이 좋다 .
2.10 Serial Line Throughput Calculations
21Computer Network Lab.
Point-to-Point link 에서 MTU 를 296 으로 정한 이유
256+40(TCP + IP header)=296 이다 . 그러나 CSLIP 을
사용하는 경우 40 을 5 로 줄이기 때문에 261byte fra
me 이 되고 261 중에서 98.1%(256/261) 는 data, 1.9%
(5/261) 가 header 이므로 좋은 utilization 이라고 할
수 있다 .
2.10 Serial Line Throughput Calculations(Cont’d)
22Computer Network Lab.
2.11 요약
이더넷과 IEEE 802.2/802.3 캡슐화의 차이점
SLIP 과 PPP 캡슐화 차이점
SLIP 과 PPP 는 둘 다 저속 링크에서 사용되기 때문에
종종 변하지 않는 필드는 압축하는 방법사용
루프백 인터페이스
MTU 와 path MTU