통신 프로토콜 200530032 김영준.

Slides:



Advertisements
Similar presentations
Florida State UniversityCOP Advanced Unix Programming Raw Sockets Datalink Access Chapters 25, 26.
Advertisements

COMS W6998 Spring 2010 Erich Nahum
The Journey of a Packet Through the Linux Network Stack
Taekyung Kim 0x410 ~ 0x International Standards Organization (ISO) is a multinational body dedicated to worldwide agreement on international.
LINUX NETWORK IMPLEMENTATION Jianyong Zhang. Introduction The layer structure of network: 1) BSD socket layer: general data structure for different protocols.
Introduction1-1 message segment datagram frame source application transport network link physical HtHt HnHn HlHl M HtHt HnHn M HtHt M M destination application.
ISO/OSI Model Layers Application: applications that use the network. This is were mail, browsers, ftp, etc reside Presentation: data formats, character.
Implementation of TCP/IP in Linux (kernel 2.2) Rishi Sinha.
Review of Important Networking Concepts
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 TCP/IP Stack Introduction: Looking Under the Hood! Shiv Kalyanaraman Rensselaer Polytechnic Institute.
Socket Programming.
The Basics of communication LectureII. Processing Techniques.
1 Application TCPUDP IPICMPARPRARP Physical network Application TCP/IP Protocol Suite.
1 Application Presentation Session Transport Network Datalink Physical OSI model Application IPv4, IPv6 Device Driver Hardware TCPUDP Internet.
Defining Network Protocols Application Protocols –Application Layer –Presentation Layer –Session Layer Transport Protocols –Transport Layer Network Protocols.
Introduction to Linux Network 劉德懿
Packet Analysis with Wireshark
1 Introduction to Raw Sockets 2 IP address Port address MAC address TCP/IP Stack 67 Bootp DHCP OSPF protocol frame type UDP Port # TCP Port.
1 Networking (Stack and Sockets API). 2 Topic Overview Introduction –Protocol Models –Linux Kernel Support TCP/IP Sockets –Usage –Attributes –Example.
Socket Programming. Introduction Sockets are a protocol independent method of creating a connection between processes. Sockets can be either – Connection.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
LOGO “ Add your company slogan ” Damaga ( 다막아 ) 핵심 0703 프로젝트.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 3: TCP/IP Architecture.
The OSI Model and the TCP/IP Protocol Suite
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
TCP/IP: Basics1 User Datagram Protocol (UDP) Another protocol at transport layer is UDP. It is Connectionless protocol i.e. no need to establish & terminate.
Introduction to Networking and TCP/IP J. H. Wang Jun. 8, 2005.
The complete picture Linux Network Management. End to End Connection Being able to describe the end to end connection sequence is a useful thing Very.
Networking Colin Alworth May 26, Quick Review IP address: four octets Broadcast addresses –IP addresses use all 1’s for the host bits, and whatever.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 26.
1 UDP : User Datagram Protocol Computer Network System Sirak Kaewjamnong.
Presented by Rebecca Meinhold But How Does the Internet Work?
1 Introduction to TCP/IP. 2 OSI and Protocol Stack OSI: Open Systems Interconnect OSI ModelTCP/IP HierarchyProtocols 7 th Application Layer 6 th Presentation.
Socket Buffer 발표자 유 종 욱 발표일 2003년 10월.
Socket Programming.
1 Bus topology network. 2 Data is sent to all computers, but only the destination computer accepts 02608c
Computer Communication: An example What happens when I click on
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
Transmission Control Protocol (TCP) Internet Protocol (IP)
Page 12/9/2016 Chapter 10 Intermediate TCP : TCP and UDP segments, Transport Layer Ports CCNA2 Chapter 10.
Fall 2004FSU CIS 5930 Internet Protocols1 TCP/IP Protocol Suite Reading: Chapter 13.
A network primer (or refresher) Henning Schulzrinne (based on slides from Kurose/Ross)
TCP/IP Protocol Suite 1 Chapter 11 Upon completion you will be able to: User Datagram Protocol Be able to explain process-to-process communication Know.
Cisco I Introduction to Networks Semester 1 Chapter 7 JEOPADY.
1 Socket Interface. 2 Basic Sockets API Review Socket Library TCPUDP IP EthernetPPP ARP DHCP, Mail, WWW, TELNET, FTP... Network cardCom Layer 4 / Transport.
UDP. User Datagram Protocol (UDP)  Unreliable and unordered datagram service  Adds multiplexing  No flow control  Endpoints identified by ports 
Lecture 3: Stateless Packet Filtering. 2 Agenda 1 1 Linux file system - networking sk_buff 2 2 Stateless packet filtering 3 3 About next assignment 4.
SOCKET PROGRAMMING Presented By : Divya Sharma.
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
Introduction to TCP/IP networking
Multiplexing.
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
A quick intro to networking
Introduction to TCP/IP
What the OSI Protocol Layers Do
© 2003, Cisco Systems, Inc. All rights reserved.
Network Architecture Introductory material
Encapsulation/Decapsulation
Transport layer API: Socket Programming
Review of Important Networking Concepts
شبکه های کامپیوتری پیشرفته
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Linux Networks TCP/IP Networking Layers BSD Socket Interface
Socket Program Training
Transport Protocols An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
6. TCP/IP 주요 내용 OSI Transport Layer TCP/UDP.
Network Architecture Models: Layered Communications
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Chapter 4: outline 4.1 Overview of Network layer data plane
Presentation transcript:

통신 프로토콜 200530032 김영준

계층 구조 BSD socket INET socket TCP UDP IP PLIP SLIP ETHERNET ARP Parallel port Serial port Ethernet card

BSD socket 대표적인 소켓 인터페이스 socket() 프로토콜을 선택하는 인터페이스 bind() 보내는 호스트와 응용을 선택 connect() 목적지 호스트 주소와 응용을 선택 accept() 서버가 통신 요청을 받아들일 때 listen() 서버가 동시에 몇 개의 서비스 요청을 결정할 때 send() , recv() 사용자는 프로토콜 패밀리(도메인) 선택 INET(TCP/IP), UNIX, IPX, APPLETALK, X25, AX25

INET socket & TCP/UDP INET socket - 소켓의 type 설정 Stream, Datagram, Raw, Reliable Delivered Messages UDP – connectionless protocol 패킷을 전송할 때 목적지에 안전하게 도착했는지 신경 X TCP – connection oriented protocol 일련의 패킷에게 seq number, ack number 설정, State 유지, 데이터가 정확하게 수신되었는지 확인

IP IP 주소를 사용하여 통신, 자신의 고유한 4octets IP 주소를 갖는다. /etc/hosts or DNS 를 통해 알 수 있다. Checksum, fragmentation, 다른 호스트로 forwarding 수행, queue discipline에 따라 패킷 흐름 제어(shaping)

데이터 encapsulation Ethernet frame IP packet TCP message Destination ethernet address Source ethernet address Protocol Data CRC IP packet Version Transport Checksum Source IP address Destination IP address Data TCP message Source port Destination port SEQ ACK Data Application data Application header Data

/etc/services

주요 커널 내부 자료 구조 Linux는 계층 사이에서 제어가 전달될 때 자료 구조를 이용한 간접 호출 방법으로 통신 프로토콜을 구현 Direct func. Call X  Indirect func. Call O 하위 층이 제공하는 함수의 시작 주소를 특정 자료 구조 (테이블) 로 등록, 상위 층은 이 자료구조에 등록된 함수를 호출 특징 상위 층과 하위 층간에 종속관계 X 내용 수정, 새로운 층 추가 시 커널 변경이 간단해 짐 소스코드는 복잡하고 분석 어려움

/* include/linux/skbuff.h */ 통신 프로토콜이 사용하는 주요 자료 구조 VFS layer struct file_operations /* include/linux/fs.h */ BSD socket layer struct net_proto_family /* include/linux/net.h */ struct socket /* include/linux/net.h */ inet layer struct sock /* include/net/sock.h */ struct proto_ops /* include/linux/net.h */ struct sk_buff /* include/linux/skbuff.h */ transport layer struct tcp_opt /* include/linux/fs.h */ struct proto /* include/net/sock.h */ IP layer struct tcp_func /* include/net/tcp.h */ struct packet_type /* include/linux/netdevice.h */ device layer struct device /* include/net/netdevice.h */

Sock과 sock 자료 구조 file task dentry VFS layer BSD socket layer srtuct sock { next, prev daddr, dport rcv_saddr, sport state … rmem_alloc recevie_queue wmem_alloc write_queue pair /*struct sock*/ prot /*struct proto*/ tp_pinfo dst_cache } … f_dentry f_pos f_op srtuct socket { state type flags ops /*proto_ops*/ sk /*struct sock*/ files, inodes next, wati, … } … fd_array[] srtuct dst_entry { … *dev ; *hh ; (*input) (*output) } dentry d_inode srtuct device { … } srtuct proto_ops { family dup, release, bind, connect, accept, listen, … getsockops setsockops sendmsg recvmsg } INET layer TCP layer IP layer Driver layer

sk_buff 자료 구조 /*include/linux/skbuff.h*/ struct sock struct sk_buffer { next, prev struct sock *sk ; … /*TP layer header*/ union {th, uh, icmph, …} h ; /*Network layer header*/ union {iph, ipv6h, arph, …} h ; /*Data Link header*/ union {ethernet, raw} mac ; struct dst_entry *dst ; data, head, len } sk_buff head data … sk_buff head data … struct device sk_buff head data …

제어 흐름 : 데이터 전송 VFS BSD socket inet socket TCP IP Device Linux Kernel /*fs/read_write.c*/ VFS sys_write() BSD socket /*net/socket.c*/ sock_write() inet socket /*net/ipv4/af_inet.c*/ inet_sendmsg() TCP /*net/ipv4/tcp_output.c*/ tcp_send_skb() IP /*net/ipv4/ip_output.c*/ ip_queue_xmit() Device /*driver/net/3c509.c*/ el3_start_xmit() Linux Kernel

제어 흐름 : 데이터 수신 VFS BSD socket inet socket TCP IP Device Linux Kernel /*fs/read_write.c*/ VFS sys_read() BSD socket /*net/socket.c*/ sock_read() inet socket /*net/ipv4/af_inet.c*/ inet_recvmsg() wake up TCP /*net/ipv4/tcp.c*/ /*net/ipv4/tcp_input.c*/ tcp_recvmsg() tcp_v4_rcv() IP /*net/ipv4/ip_input.c*/ ip_recv() sleep Device /*driver/net/3c509.c*/ /*net/core/dev.c*/ net_bh() el3_interrupt() Linux Kernel