Session 25: Netlink Sockets 문준혁. Index What are netlink sockets? Opening a netlink socket –Family Netlink messages –nlmsg_type –nlmsg_flags Lab.

Slides:



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

TCP/IP Protocol Suite 1 Chapter 27 Upon completion you will be able to: Next Generation: IPv6 and ICMPv6 Understand the shortcomings of IPv4 Know the IPv6.
Network Layer IPv6 Slides were original prepared by Dr. Tatsuya Suda.
21.1 Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Internet Control Protocols Savera Tanwir. Internet Control Protocols ICMP ARP RARP DHCP.
資 管 Lee Lesson 12 IPv6 Mobility. 資 管 Lee Lesson Objectives Components of IPv6 mobility IPv6 mobility messages and options IPv6 mobility data structures.
Lecture 5: TCP/IP OSI layers 3 (IP) and 4 (TCP/UDP) IPv4 – addresses and routing, “best-effort” service Ethernet, Appletalk, etc wrap IP packets with their.
S305 – Network Infrastructure Chapter 5 Network and Transport Layers Part 2.
The Network Layer Chapter 5. The IP Protocol The IPv4 (Internet Protocol) header.
TCP/IP Network and Firewall. IP Packet Protocol  1 ICMP packet  6 TCP packet  17 UDP packet.
1 Application TCPUDP IPICMPARPRARP Physical network Application TCP/IP Protocol Suite.
1 Internet Control Message Protocol (ICMP) RIZWAN REHMAN CCS, DU.
Chapter Overview TCP/IP Protocols IP Addressing.
Introduction to Linux Network 劉德懿
Internet Control Message Protocol ICMP. ICMP has two major purposes: –To report erroneous conditions –To diagnose network problems ICMP has two major.
Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES Internet Control Message Protocol ICMP author -- J. Postel, September The purpose.
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.
Network Communications Technology Chapter 19 Internet Architecture and TCP/IP.
TCOM 515 IP Routing Lab Lecture 1. Class information Instructor: Wei Wu –Lecture and Lab session 2 – Instructor:
IPv6 Mobility Milo Liu SW2 R&D ZyXEL Communications, Inc.
TCP/IP Illustracted Vol1. 제목 : IP Routing ( 수 ) 한 민 규
CDPA 網管訓練 駭客任務 2 Ethernet Switching ARP, IP, LAN, Subnet IP Header, Routing ICMP
1 Tutorial 6: Networking Utilities & Firewall. 2 Internet Control Message Protocol (ICMP) designed to compensate for the deficiencies of IP protocol.
Fall 2005Computer Networks20-1 Chapter 20. Network Layer Protocols: ARP, IPv4, ICMPv4, IPv6, and ICMPv ARP 20.2 IP 20.3 ICMP 20.4 IPv6.
TCOM 515 IP Routing. Syllabus Objectives IP header IP addresses, classes and subnetting Routing tables Routing decisions Directly connected routes Static.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
Network Programming Eddie Aronovich mail:
Internet Protocols. Address Resolution IP Addresses are not recognized by hardware. If we know the IP address of a host, how do we find out the hardware.
1 Network Layer Lecture 16 Imran Ahmed University of Management & Technology.
DoS Suite and Raw Socket Programming Group 16 Thomas Losier Paul Obame Group 16 Thomas Losier Paul Obame.
Protocol Headers 0x0800 Internet Protocol, Version 4 (IPv4) 0x0806 Address Resolution Protocol (ARP) 0x8100 IEEE 802.1Q-tagged frame 0x86DD Internet Protocol,
ICMP : Internet Control Message Protocol
Networking Fundamentals Network Protocols. Protocol Rule for how networks communicate Each OSI layer handled by one or more protocols Protocol Suites.
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.
Understanding IPv6 Slide: 1 Lesson 12 IPv6 Mobility.
CS492b Project #3-2 KIP router KAIST Dept. of CS NC Lab.
1 Requirements for Internet Routers (Gateways) and Hosts Relates to Lab 3. (Supplement) Covers the compliance requirements of Internet routers and hosts.
TCP/IP Illustracted Vol1. 제목 : IP Routing ( 수 ) 한 민 규
OV Copyright © 2013 Logical Operations, Inc. All rights reserved. TCP/IP Addressing and Data Delivery  The TCP/IP Protocol Suite  IP Addressing.
Lecture 21: Network Primer 7/9/2003 CSCE 590 Summer 2003.
TCP/IP PROTOCOL UNIT 6. Overview of TCP/IP Application FTP, Telnet, SMTP, HTTP.. Presentation Session TransportHost-to-HostTCP, UDP NetworkInternetIP,
Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TDC375 Autumn 03/04 John Kristoff - DePaul University 1 Network Protocols Internet Protocols Overview.
IP - Internet Protocol No. 1  Seattle Pacific University IP: The Internet Protocol Kevin Bolding Electrical Engineering Seattle Pacific University.
Network and System Security Risk Assessment
Internet Control Message Protocol (ICMP)
© 2003, Cisco Systems, Inc. All rights reserved.
Internet Control Message Protocol (ICMP)
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Introduction to TCP/IP
Transport Layer (Part 2)
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol
8 Network Layer Part V Computer Networks Tutun Juhana
Byungchul Park ICMP & ICMPv DPNM Lab. Byungchul Park
Chapter 5 Network and Transport Layers
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP)
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.
Advanced Computer Networks
Internet Control Message Protocol (ICMP)
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Internet Control Message Protocol (ICMP)
CPEG512 Advanced Computer Networks
46 to 1500 bytes TYPE CODE CHECKSUM IDENTIFIER SEQUENCE NUMBER OPTIONAL DATA ICMP Echo message.
16EC Computer networks unit II Mr.M.Jagadesh
Review of Internet Protocols Network Layer
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Presentation transcript:

Session 25: Netlink Sockets 문준혁

Index What are netlink sockets? Opening a netlink socket –Family Netlink messages –nlmsg_type –nlmsg_flags Lab

What are netlink sockets? Kernel 과 user space 사이의 통신 방법 여러 프로세스 그룹으로 멀티캐스트 전송이 가능 Network system 관리와 모니터링에 사용 –Ex) firewalls 와 routing 의 제어 전송하는 Message 들은 UDP 와 같은 datagrams. –UDP : 신뢰할 수 없는 protocol –Message 가 전달 될 수 없다면 drop 된다. Message 는 byte stream 으로 구성되어 있으며, header 들과 datapayload 를 포함한다.

Opening a netlink socket #include Netlink_socket = socket (PF_NETLINK, type, family); struct sockaddr_nl { sa_family_t nl_family; /* AF_NETLINK */ unsigned shortnl_pad; /* zero*/ pid_t nl_pid; /* process pid */ _u32nl_groups; /* multicast groups mask */ };

Family Description NETLINK_ROUTE Routing packet 들을 받거나 routing table 을 수정 (IPV4) NETLINK_SKIP Enskip 를 예약 NETLINK_USERSOCK 앞으로 사용할 User space protocol 들을 예약 NETLINK_FIREWALL Firewall code 를 위한 packet 들을 받음 (IPV4) NETLINK_TCPDIAG TCP socket 들을 monitoring 하기 위함 NETLINK_NFLOG Netfilter 와 iptable 들을 logging 하기 위함 NETLINK_ARPD ARP table 을 운영 (Address Resolution Protocol) NETLINK_ROUTE6 Routing packet 들을 받거나 routing table 을 수정 (IPV6) NETLINK_IP6_FW Firewall code 를 위한 packet 들을 받음 (IPV6) NETLINK_DNRTMSGDecnet routing messages

Netlink messages Netlink message 는 nlsmghdr data structure 로 설명됨 Struct nlmsghdr { _u32nlmsg_len;/*Length of message including header*/ _u16nlmsg_type;/*Message content*/ _u16nlmsg_flags;/*Additional flags*/ _u32nlmsg_seq;/*Sequence number*/ _u32nlmsg_pid;/*Sending process PID*/ }; Struct nlmsgerr { interror; struct nlmsghdrmsg; };

nlmsg_type Message TypeDescription NLMSG_NOOP Message 를 무시함 NLMSG_ERROR Error message 신호 NLMSG_DONE Message 가 Multipart message 의 종료 NLMSG_OVERRU N Data 손실 신호

nlmsg_flags #define NLM_F_REQUEST 1 /* 요청 메시지 */ #define NLM_F_MULTI 2 /*multipart 메시지, NLMSG_DONE 에 의해 종료 */ #define NLM_F_ACK 4 /*ack, zero, error code 와 함께 응답 */ #define NLM_F_ECHO 8 /*Echo this request*/ /*Modifiers to GET request*/ #define NLM_F_ROOT0x100 /*tree root 명시 */ #define NLM_F_MATCH0x200 /* 모든 matching 반환 */ #define NLM_F_ATOMIC0x400 /*atomic GET*/ #define NLM_F_DUMP(NLM_F_ROOT | NLM_F_MATCH) /*Modifiers to NEW request*/ #define NLM_F_REPLACE0x100 /* 존재하는 것을 무시 */ #define NLM_F_EXCL0x200 /* 존재하는 경우 그대로 둠 */ #define NLM_F_CREATE0x400 /* 존재하지 않는 경우 생성 */ #define NLM_F_APPEND0x800 /* 리스트의 끝에 추가 */

Lab Lab 2 : Using Netlink to send kernel messages to an application