Presentation is loading. Please wait.

Presentation is loading. Please wait.

6. TCP/IP /* 컴퓨터 네트워크 -안순시,김은기 저- 참조 */

Similar presentations


Presentation on theme: "6. TCP/IP /* 컴퓨터 네트워크 -안순시,김은기 저- 참조 */"— Presentation transcript:

1 6. TCP/IP /* 컴퓨터 네트워크 -안순시,김은기 저- 참조 */
주요 내용 TCP/IP services TCP/IP addressing IP/ARP/RARP/ICMP TCP/UDP

2 TCP/IP Overview TCP is the most widely-used transport protocol in the world TCP/IP was developed for the U.S. DOD Arpanet. TCP/IP was designed in early 1970s. TCP/IP Delivered in 4.2BSD Unix as a complete software package. The success of the applications layer software on top of TCP solidified the hold of TCP in the transport layer.

3 TCP and the “little person”
On the bottom side, TCP does not see routers and LANs. From its perspective, everyone is attached to a “cloud” via an IP quadword address. Routers are invisible On the top side, TCP provides a connection-oriented service to the application layer. Think of TCP as an efficient secretary. It gets from the layer above a source port a destination port and a destination IP address a message. TCP is also aware that messages may have to be broken up into packet-sized chunks.

4 TCP/IP 용어 The nodes on an IP network, the ones that implement the full stack: hosts. Those that don’t implement the full stack : routers, or gateways. Hosts are physically attached to layer 2 networks (usually LANs). Each host has a MAC address for each subnetwork it is connected to. Each host usually has an IP address for each subnetwork connection Two services, TCP and UDP, sit on top of the IP layer. TCP is connection-oriented UDP adds little to IP. Applications use the services.

5 Hosts are multitasking, have many processes.
Each process participating in the TCP/IP stack is associated with a port. When an application wants to talk to another it uses the IP address and port of the other application.

6 TCP/IP 응용 계층 구조

7 TCP/IP 서비스 사용자 서비스 및 프로토콜 ping 연결시험을 위해 ICMP 프로토콜을 사용 telnet rsh ftp
인터넷상의 임의의 두 호스트간에 연결이 되어있는지 테스트하기 위해 사용 연결시험을 위해 ICMP 프로토콜을 사용 telnet rsh ftp 지원 서비스 및 프로토콜 DNS SMTP RPC [그림 6.1], [그림 6.2] 참조

8 Internet Services finger time email/SMTP news/NNTP archie/veronica
telnet/rlogin gopher WAIS World Wide Web SNMP NFS FTP DNS Moo/MUD IRC others?

9 Background is a rewiring technology, changing social patterns. Until the appearance of the Web, it was by far the single most important application layer service of the Internet. in internetworking is bigger than the Internet, since many other networks provide gateways into the Internet (the old usenet, for example)

10 How email works: Programs
Three host programs are involved A mail agent for the user (e.g., mail, elm, pine) A transfer agent (e.g. sendmail) to move the mail around A POP or IMAP agent to communicate with remote clients (e.g. Eudora)

11 SMTP 동작절차 SMTP 클라이언트와 서버간의 연결이 확립 전자메일이 연결을 따라 전송
보낼 메일이 있을 때 SMTP 클라이언트는 TCP 포트번호 25를 사용하여 SMTP 서버와의 TCP 연결을 개방: HELO 명령어 SMTP 서버는 메일을 수신하기 위한 상태를 나타내는 응답을 클라이언트에게로 보낸다. 전자메일이 연결을 따라 전송 메일 전송은 메시지를 보내는 사용자의 이름을 포함하는 Mail 명령어로 시작 그 다음으로 메시지의 수신자를 표시하는 하나 이상의 Rcpt 명령어

12 연결해제 Data 명령어가 실제의 메시지 문서의 전송
SMTP 서버는 각각의 명령에 대하여 적절한 응답으로 대응 오류 점검과 재전송에 대한 TCP 메카니즘이 메일 메시지의 성공적인 전송을 보증하기 위하여 사용 연결해제 SMTP 클라이언트는 Quit 명령어를 보냄으로서 연결을 폐쇄 양쪽 모두 TCP 연결을 해제하기 위하여 TCP 폐쇄동작을 수행

13 >>>로 시작하는 줄은 SMTP 클라이언트가 보내는 명령어
[그림6.3] 실험 예 kowon [htlim ~ {5}]mailx -v Subject: test this is test. . >>>로 시작하는 줄은 SMTP 클라이언트가 보내는 명령어 3자리 응답 코드로 시작하는 문장은 SMTP 서버가 보내는 문장 SMTP 관련 명령어들은 ASCII로 된 4-바이트 명령어로 시작 [그림 6.4]

14 FTP(File Transfer Protocol)
교재 페이지 183

15 TELNET 원격지 호스트에의 연결에 사용 과정 RLOGIN(Remote Login)과 유사
클라이언트: 입력된 사용자 데이타(명령)를 서버에 전송 서버: 수신된 명령을 수행 결과를 클라이언트에 전송 클라이언트: 수신된 결과를 화면에 출력 RLOGIN(Remote Login)과 유사

16 SNMP(Simple Network Management Protocol)
망 관리 기능 서버는 관리되는 객체(managed object)에 관한 정보를 MIB(Management Information Base)에 계층적으로 저장

17 DNS(Domain Name System)
계층적 인터넷 주소 응용 계층: 문자 주소 예: kowon.dongseo.ac.kr IP 계층: 숫자 주소 예: 응용 계층 주소로부터 IP 계층 주소로의 매핑

18 TCP/IP 주소지정 세가지 호스트 식별자 Host name IP address Physical Hardware address
예: kowon.dongseo.ac.kr IP address 예: Physical Hardware address 48비트 MAC address

19 식별자 변환 호스트 이름을 인터넷 주소로의 변환 인터넷 주소를 물리적인 하드웨어 주소로의 변환 DNS /etc/hosts
인터넷 주소를 물리적인 하드웨어 주소로의 변환 ARP: Address Resolution Protocol RARP: Reverse ARP

20 인터넷 주소지정 32비트 길이이며 두 부분 즉 네트워크 식별자와 호스트 식별자로 구성
IP는 IP 데이타그램이 송신측 호스트에서 목적지 호스트로 전송되는 라우팅(routing)기능을 수행 인터넷을 통해 전달되는 IP 데이타그램 각각의 헤더는 송신측 호스트의 인터넷 주소와 목적지 호스트의 인터넷 주소를 포함 인터넷 주소 형식 32비트 길이이며 두 부분 즉 네트워크 식별자와 호스트 식별자로 구성 네트워크 식별자의 앞쪽 비트들은 인터넷 주소가 어느 등급(class)에 속해있는지를 식별

21 IP address 구조

22 점-십진(Dotted-decimal) 표기
등급 B는 에서 까지의 범위 등급 C는 에서 까지의 범위

23 Subnetting 원래 TCP/IP 주소지정 방식은 네트워크 식별자와 호스트 식별자로 단지 2단계 계층만을 허용
서브넷 식별자: [그림 6.9] 서브넷 마스크(mask): [그림 6.10] 인터넷 주소중 몇 비트가 네트워크를 식별하기 위해 사용되는지 그리고 몇 비트가 호스트를 식별하기 위해 사용되는지 구분 예: 등급 A: , 등급 B:

24 주소 구조(하나의 서브넷에 여러개의 망)

25 IP(Internet Protocol)
IP는 TCP/IP 인터넷 계층에서 동작되며 데이터 단위를 출발지 호스트에서 목적지 호스트로 전달 IP에서의 데이터 단위: IP 데이타그램 또는 패킷 IP 데이타그램의 헤더부분 출발지 호스의 인터넷 주소와 목적지 호스트의 인터넷 주소를 포함 IP는 비연결 데이터 전달 서비스를 제공 흐름제어나 오류회복을 하지 않는다. 가능한 오류 손실된 IP 데이타그램 순서화 되지 않은(out-of-sequence) IP 데이타그램 복제(duplicate) IP 데이타그램 TCP : 오류들을 탐지해서 회복할 수 있는 기능을 책임

26 IP 데이타그램(패킷) 구조

27 IP routing [그림 6.12] Sample Network

28 Node a.ncat.edu wants to send one IP packet to www.acme.com.
가정:None of the nodes have any cached data. The only information they have is what is shown in the diagram. The table below shows all of the packets that would be sent.

29 IP routing 동작절차 [그림 6.13] 호스트에서의 IP routing할때 두가지 경우
목적지가 같은 네트워크내에 있는 경우 바로 목적지 호스트에게 IP 데이타그램 전달 목적지가 다른 네트워크에 있는 경우 IP 라우팅 기능을 사용하여 라우터에게 전달 각 호스트는 각각의 라우팅 테이블을 유지 라우팅 테이블은 적어도 하나의 default router의 주소를 포함하는 엔트리를 포함

30 3) 호스트 A의 IP 프로세스는 ARP 캐쉬를 조회
같은 네트워크 상에서의 데이타그램 전달의 예 [그림 6.13]에 있는 호스트 A에서 호스트 B로 IP 데이타그램 전달 1) B의 네트워크 ID 값과 A 자신의 네트워크 ID 값을 비교하기 위해 서브넷 마스크를 사용 2) A와 B의 네트워크 ID 값은 서로 같으므로 IP 데이타그램을 직접 전달하기 위해 B의 물리적인 하드웨어 주소를 알아야 함 3) 호스트 A의 IP 프로세스는 ARP 캐쉬를 조회 4-1) 조회하여 있으면 호스트 IP 데이타그램을 직접 호스트 B로 전달 4-2) 조회하여 없으면 ARP 프로토콜 동작

31 3) A의 IP 프로세스는 default router의 물리적인 하드웨어 주소를 알기 위하여 다시 ARP 캐쉬를 조회
다른 네트워크로의 데이타그램 전달 [그림 6.13]에 있는 호스트 A에서 호스트 D로 IP 데이타그램 전달 1) D의 네트워크 ID 값과 A 자신의 네트워크 ID 값을 비교하기 위해 서브넷 마스크를 사용 2) A와 D의 네트워크 ID 값은 서로 다르므로 IP 데이타그램의 A는 자신의 라우팅 테이블을 검색(이경우 default router 사용) 3) A의 IP 프로세스는 default router의 물리적인 하드웨어 주소를 알기 위하여 다시 ARP 캐쉬를 조회 4-1) 조회하여 있으면 호스트 IP 데이타그램을 직접 default router로 전달 4-2) 조회하여 없으면 ARP 프로토콜 동작 5) default router는 1) ~4) 동작을 반복

32 Introduction - the future of IP (IPv6)
Current version of IP - version 4 - is 20 years old IPv4 has shown remarkable ability to move to new technologies IETF has proposed entirely new version to address some specific problems IP has accommodated dramatic changes since original design Basic principles still appropriate today Scaling Size - from a few tens to a few tens of millions of computers Speed - from 56Kbps to 1Gbps

33 IP 변화의 필요성 Address space Type of service Multicast
32 bit address space allows for over a million networks But...most are Class C and too small for many organizations 2**14 Class B network addresses already almost exhausted Type of service Different applications have different requirements for delivery reliability and speed Current IP has type of service that's not often implemented Multicast

34 New features Address size - IPv6 addresses are 128bits
Header format - entirely different Extension headers - Additional information stored in optional extension headers, followed by data Support for audio and video - flow labels and quality of service allow audio and video applications to establish appropriate connections Extensible - new features can be added more easily

35 IPv6 address notation 128-bit address--> dotted decimal; requires 16 numbers Groups of 16-bit numbers in hex separated by colons- colon hexadecimal (or colon hex) DC:8864:FFFF:FFFF:0:1280:8C0A:FFFF Zero-compression - series of zeroes indicated by two colons FF0C:0:0:0:0:0:0:B1 FF0C::B1 IPv6 address with 96 leading zeros is interpreted to hold an IPv4 address

36 ARP(Address Resolution Protocol)
계층간의 주소 구조 IP 계층: IP 주소 IP 하위 계층: 물리적인 하드웨어 주소(PHA) 동일한 망내 호스트 들간의 패킷 교환 IP 계층에 망내 호스트 들의 “IP 주소, PHA 주소” 테이블 (ARP cache) IP 계층 동작 패킷의 수신지 IP 주소에 해당하는 PHA 주소로 패킷 전송 ARP IP 주소에 해당하는 PHA 주소를 모르는 경우

37 ARP의 동작 절차 1) ARP request packet 을 LAN상에 broadcast
ARP request packet 내용: 알고자 하는 호스트의 IP 주소 자신의 IP 주소, PHA 주소 2) LAN상의 모든 호스트에서 동작하는 ARP 프로세스는 ARP request packet 수신 3) B는 자신의 PHA 주소를 포함하는 ARP response packet을 송신측에 전송 4) A가 ARP 응답 패킷을 받을 때 호스트 A는 그 ARP 캐쉬 내에 호스트 B의 물리적인 하드웨어 주소를 저장 5) A는 ARP 캐쉬 엔트리에 있는 정보를 사용 [그림 6.16], [그림 6.17], [그림 6.18]

38 RARP(Reverse ARP) PHA 주소를 알고, 그에 해당하는 IP 주소를 모르는 경우
디스크 없는 워크스테이션(Diskless Workstation)에서 사용

39 인터넷 제어 메시지 프로토콜(ICMP) ICMP(Internet Control Message Protocol)의 기능
에러 보고(Error Reporting) 도착 가능 검사(Reachability Testing) 혼잡 제어 수신측 경로 변경 [그림 6.19] [그림 6.20] [그림 6.21]

40 TCP(Transmission Control Protocol)
Features of TCP Connection oriented Point-to-point: A TCP connection has two endpoints Reliability: TCP guarantees data will be delivered without loss, duplication or transmission errors Full duplex Stream interface: Application delivers data to TCP as a continuous stream Reliable connection startup: Three-way handshake guarantees reliable, synchronized startup between endpoints Graceful connection shutdown: TCP guarantees delivery of all data after endpoint shutdown by application

41 TCP 프로토콜 상위 계층의 구조

42 TCP 계층 서비스 수행 과정의 예

43 TCP 계층 PDU 구조

44 TCP/IP 계층의 주소 구조

45 TCP 프로토콜 메카니즘 Connection establishment: Three-way handshake
Data transfer Error detection and retransmission Sequence Number, Ack. Number, Checksum field 재전송 timer Flow control Window size Congestion control Connection release: Three-way handshake

46 Three-way handshake TCP uses three-way handshake for reliable connection establishment and termination Host 1 sends segment with SYN bit set and random sequence number Host 2 responds with segment with SYN bit set, acknowledgment to Host 1 and random sequence number Host 1 responds with acknowledgment TCP will retransmit lost segments Random sequence numbers ensure synchronization between endpoints

47 Opening a connection Closing a connection Two-army Problem [그림 6.25]
[그림 6.26] Two-army Problem Computer Networks(3rd ed.)-Tanenbaum

48 UDP(User Datagram Protocol)
UDP 프로토콜 PDU 구조

49 TCP와 UDP의 비교


Download ppt "6. TCP/IP /* 컴퓨터 네트워크 -안순시,김은기 저- 참조 */"

Similar presentations


Ads by Google