This document provides an overview of advanced socket programming concepts including socket options, POSIX name and address conversion functions like getaddrinfo() and getnameinfo(), out-of-band data, and signal driven I/O. It describes common socket options, their uses, and functions for getting and setting option values. It also summarizes POSIX replacement functions for hostname lookups and discusses how out-of-band data can be used to send high priority messages and when SIGIO signals may be generated.
This document discusses the evolution of high-speed client interfaces, including 100G and emerging 400G interfaces. It provides details on current and upcoming interface types for both telecom and data center applications. Key interface technologies discussed include 100GBASE-LR4, PSM4, CWDM4, and emerging 400G interfaces using higher order modulation and forward error correction. The document also covers pluggable form factors like CFP2 and QSFP28 and their role in enabling dense 100G and 400G connectivity.
Отказоустойчивость с использованием Cisco ASA ClusteringCisco Russia
Отказоустойчивость с использованием Cisco ASA Clustering - принципы работы, ограничения, диагностика.
Ссылка на запись вебинара: https://www.youtube.com/watch?v=h73ZVhSqd64
This document outlines an IPv6 lab and techtorial that covers IPv6 addressing, neighbor discovery, static routing, OSPFv3, BGP, and tunneling. The agenda includes lectures on these topics as well as corresponding labs to provide hands-on experience. Prerequisites for the session are basic network engineering knowledge and interest in Cisco technologies. The document then goes on to describe IPv6 addressing formats, types of addresses, and how addresses are allocated to interfaces.
This document discusses Internet Protocol version 6 (IPv6). It provides an introduction to IPv6 and the need to transition from IPv4. IPv4 only provides 4.3 billion addresses while the growth of devices requiring IP addresses continues to rise. IPv6 features a 128-bit address space providing vastly more unique addresses than IPv4. It also includes improvements in areas like auto-configuration and network layer security. The document reviews IPv4 limitations and outlines various IPv6 address types including unicast, multicast, and anycast. It describes transition mechanisms such as dual stack, tunneling, and header translation to help migrate from IPv4 to IPv6. Key advantages of IPv6 include a huge number of addresses and additional features, but
This document provides an overview and agenda for a session on advanced topics in IP multicast deployment. It discusses tools and techniques for deploying IP multicast, including examples of PIM mode configurations, rendezvous point deployment models, interconnecting PIM domains, label switched multicast, high availability techniques, and multicast in wireless environments. The target audience is network engineers in enterprise and service provider networks.
This presentation compares IPv4 and IPv6. It begins with introductions of the group members and defines IP as an Internet Protocol address assigned to devices connected to a network. It then discusses the evolution of IP versions from IPv1 to the current IPv6. Key details provided include that IPv4 uses 32-bit addresses limiting its capacity while IPv6 uses 128-bit addresses allowing for vast expansion. The presentation outlines advantages and limitations of IPv4 and reasons for the development of IPv6, including the growing shortage of IPv4 addresses. It clarifies that IPv4 and IPv6 are not compatible but can co-exist on networks using dual stack technology.
Data communication and network Chapter - 2Zafar Ayub
The document discusses network protocols and Ethernet. It provides details on:
- Common network protocols include Ethernet, LocalTalk, Token Ring, FDDI, and ATM. Ethernet is the most widely used protocol.
- Ethernet uses CSMA/CD access method where nodes listen before transmitting and can detect collisions. It operates at speeds of 10 Mbps, 100 Mbps, 1 Gbps, and 10 Gbps.
- Ethernet standards include IEEE 802.3 for 10BASE-T, 802.3u for 100BASE-TX, 802.3z for 1000BASE-T, and 802.3ae for 10 Gbps.
This document discusses the evolution of high-speed client interfaces, including 100G and emerging 400G interfaces. It provides details on current and upcoming interface types for both telecom and data center applications. Key interface technologies discussed include 100GBASE-LR4, PSM4, CWDM4, and emerging 400G interfaces using higher order modulation and forward error correction. The document also covers pluggable form factors like CFP2 and QSFP28 and their role in enabling dense 100G and 400G connectivity.
Отказоустойчивость с использованием Cisco ASA ClusteringCisco Russia
Отказоустойчивость с использованием Cisco ASA Clustering - принципы работы, ограничения, диагностика.
Ссылка на запись вебинара: https://www.youtube.com/watch?v=h73ZVhSqd64
This document outlines an IPv6 lab and techtorial that covers IPv6 addressing, neighbor discovery, static routing, OSPFv3, BGP, and tunneling. The agenda includes lectures on these topics as well as corresponding labs to provide hands-on experience. Prerequisites for the session are basic network engineering knowledge and interest in Cisco technologies. The document then goes on to describe IPv6 addressing formats, types of addresses, and how addresses are allocated to interfaces.
This document discusses Internet Protocol version 6 (IPv6). It provides an introduction to IPv6 and the need to transition from IPv4. IPv4 only provides 4.3 billion addresses while the growth of devices requiring IP addresses continues to rise. IPv6 features a 128-bit address space providing vastly more unique addresses than IPv4. It also includes improvements in areas like auto-configuration and network layer security. The document reviews IPv4 limitations and outlines various IPv6 address types including unicast, multicast, and anycast. It describes transition mechanisms such as dual stack, tunneling, and header translation to help migrate from IPv4 to IPv6. Key advantages of IPv6 include a huge number of addresses and additional features, but
This document provides an overview and agenda for a session on advanced topics in IP multicast deployment. It discusses tools and techniques for deploying IP multicast, including examples of PIM mode configurations, rendezvous point deployment models, interconnecting PIM domains, label switched multicast, high availability techniques, and multicast in wireless environments. The target audience is network engineers in enterprise and service provider networks.
This presentation compares IPv4 and IPv6. It begins with introductions of the group members and defines IP as an Internet Protocol address assigned to devices connected to a network. It then discusses the evolution of IP versions from IPv1 to the current IPv6. Key details provided include that IPv4 uses 32-bit addresses limiting its capacity while IPv6 uses 128-bit addresses allowing for vast expansion. The presentation outlines advantages and limitations of IPv4 and reasons for the development of IPv6, including the growing shortage of IPv4 addresses. It clarifies that IPv4 and IPv6 are not compatible but can co-exist on networks using dual stack technology.
Data communication and network Chapter - 2Zafar Ayub
The document discusses network protocols and Ethernet. It provides details on:
- Common network protocols include Ethernet, LocalTalk, Token Ring, FDDI, and ATM. Ethernet is the most widely used protocol.
- Ethernet uses CSMA/CD access method where nodes listen before transmitting and can detect collisions. It operates at speeds of 10 Mbps, 100 Mbps, 1 Gbps, and 10 Gbps.
- Ethernet standards include IEEE 802.3 for 10BASE-T, 802.3u for 100BASE-TX, 802.3z for 1000BASE-T, and 802.3ae for 10 Gbps.
MSTP divides a bridged network into multiple regions called MST regions. Within each region, multiple RSTP instances called MSTIs are enabled to map VLANs and build separate spanning trees. A representative bridge in each region communicates with representatives of other regions to form a common spanning tree (CST) that connects all the MST regions as a single spanning tree across the entire network.
MPLS WC 2014 Segment Routing TI-LFA Fast ReRouteBruno Decraene
This document discusses Topology Independent LFA (TI-LFA), a fast reroute technique that provides 100% node and link protection using Segment Routing. It begins by outlining requirements for fast reroute, then introduces TI-LFA which computes the post-convergence path and encodes it as a loop-free Segment Routing path. The document analyzes applicability on Orange network topologies and presents simulation results showing TI-LFA achieves low stack depth and path compression. It concludes that TI-LFA is a scalable solution that meets requirements by providing optimal fast reroute paths without side effects.
Open Shortest Path First (OSPF) is an interior gateway protocol that uses link state routing and the Dijkstra algorithm to calculate the shortest path to destinations within an autonomous system. It elects a Designated Router to generate network link advertisements and assist in database synchronization between routers. Routers run the Shortest Path First algorithm on their link state databases to determine the best routes and populate their routing tables.
Access control lists (ACLs) are used to control network traffic flows between routers by filtering packets. Standard ACLs filter based on source IP address and block bidirectional traffic. Extended ACLs filter on source IP address, destination IP address, protocol and port, and can block traffic in one direction only. Wildcard masks are used in ACLs to specify which IP address bits must match for the ACL entry to apply.
Segment routing is a technology that is gaining popularity as a way to simplify MPLS networks. It has the benefits of interfacing with software-defined networks and allows for source-based routing. It does this without keeping state in the core of the network and needless to use LDP and RSVP-TE.
The document discusses using Iperf to measure network performance. Iperf can measure both TCP and UDP throughput. For TCP, it measures achievable bandwidth including the impact of the end systems. UDP provides more transparency and can directly measure loss and jitter. The document provides examples of invoking Iperf for TCP and UDP tests and discusses how to adjust settings like buffer size to optimize performance. It also describes how to use Iperf to generate high bandwidth streams and cautions against misusing it to overload networks.
The omega network is a type of banyan multistage interconnection network that uses a "perfect shuffle" interconnection pattern between stages. Cells in the omega network self-route to their destination port by examining the bit at each stage. However, like the delta network, the omega network suffers from path and output contention which can degrade performance. A Batcher sorter can be used before the omega network to sort cells by destination port, eliminating contention.
The document provides information about Zenith Networks and Juniper Networks. Zenith Networks is a partner of Juniper Networks and has over 27 years of experience providing network integration and education services. It focuses on routing, switching, security and configuration/design of LAN/WAN networks. Juniper Networks was founded in 1996 and has over 9,400 employees across 46 countries. It is known for its routing, switching and security products and connects networks around the world.
This document provides an overview of IPv6, including:
- The need for IPv6 due to the depletion of IPv4 addresses and limitations of IPv4's classful addressing.
- Techniques used to extend IPv4 like subnetting, CIDR, and NAT.
- Key features of IPv6 like its larger 128-bit address space, stateless autoconfiguration, and security improvements.
- Differences between IPv4 and IPv6 headers and IPv6's use of extension headers.
- The presentation concludes that IPv6 builds upon IPv4's foundations but addresses its limitations.
Segment Routing Advanced Use Cases - Cisco Live 2016 USAJose Liste
The document discusses segment routing and its use for inter-domain connectivity at scale. Segment routing allows source routing by encoding a path as an ordered list of segments in packet headers. It can be used to interconnect massive-scale datacenters and networks with hundreds of thousands of nodes. Segment routing scales through the use of globally unique prefix segments, redistribution of routing information only from the core to edges, and segment routing path computation elements. The path computation elements use segment routing native algorithms to optimize paths while maintaining equal-cost multipath routing.
The document discusses Advanced eXtensible Interface (AXI), which is a third generation interface specification that is targeted at high performance systems. AXI uses separate address/control and data phases to improve performance. It supports burst transactions where only the start address is issued and multiple outstanding addresses can be in flight simultaneously. AXI consists of five channels to separate read and write operations. Simulation results showed that AXI provides higher throughput than older AMBA interfaces, though older interfaces may have lower latency in some cases. AXI's standardization and flexibility make it useful for integrating IP cores.
1) The document provides an overview of IPv6 including why it was developed, its key features and improvements over IPv4 such as a vastly larger address space, more efficient routing and security features built into the protocol.
2) It describes IPv6 addressing in detail including the different address types (unicast, multicast, anycast), address formats, interface identifiers and address autoconfiguration.
3) The header format, extension headers for optional information, and new fields for quality of service and flow identification are explained in comparison to IPv4.
4) Protocols for neighbor discovery, multicast listener discovery, and address resolution that replace functions in IPv4 are outlined.
This document outlines the TCP/IP protocol stack including the TCP, IP, and Ethernet headers. It describes TCP/IP as an industry standard communication protocol consisting of four layers - application, transport, internet, and network interface. The document also briefly mentions UDP format and provides an overview of the information contained in TCP, IP, and Ethernet headers.
This document discusses configuring a Cisco router to act as a DHCP server. It describes the steps to create DHCP pools for two networks, 10.10.10.0/24 and 20.20.20.0/24, and configure the router's interfaces. It also explains the DHCP process and provides configuration snippets from the router to illustrate excluding addresses and verifying the configuration. The goal is to prepare readers for the Cisco CCNA certification exam.
This study guide is intended to provide those pursuing the CCNA certification with a framework of what concepts need to be studied. This is not a comprehensive document containing all the secrets of the CCNA, nor is it a “braindump” of questions and answers.
I sincerely hope that this document provides some assistance and clarity in your studies.
John Aynsley provides an in-depth overview of advanced UVM concepts including sequences and sequencers, virtual sequences, layered sequencers for request-response transactions, and strategies for synchronizing multiple sequencer stacks. The document discusses techniques for modeling pipelined interfaces, out-of-order responses, and idle cycles in a driver. It also examines the arbitration queue, user-defined arbitration algorithms, locking versus grabbing sequences, and using events to synchronize different components.
The document discusses various data structures and functions related to network packet processing in the Linux kernel socket layer. It describes the sk_buff structure that is used to pass packets between layers. It also explains the net_device structure that represents a network interface in the kernel. When a packet is received, the interrupt handler will raise a soft IRQ for processing. The packet will then traverse various protocol layers like IP and TCP to be eventually delivered to a socket and read by a userspace application.
This study guide is intended to provide those pursuing the CCNA certification with a framework of what concepts need to be studied. This is not a comprehensive document containing all the secrets of the CCNP nor is it a “braindump” of questions and answers.
I sincerely hope that this document provides some assistance and clarity in your studies.
Why you should be excited about ClojureScriptelliando dias
ClojureScript allows Clojure code to compile to JavaScript. Created by Rich Hickey and friends, it provides optimizations for performance while maintaining readability and abstraction. As a Lisp for JavaScript, ClojureScript controls complexity on the web and benefits from JavaScript's status as a compilation target for many languages.
SharePoint Governance and Lifecycle Management with Project Server 2010Alexander Burton
This document summarizes a presentation about using Project Server 2010 to help manage SharePoint governance and lifecycles. It discusses typical IT challenges with managing business requests, and how Project Server 2010 provides a project request and tracking framework, project selection tools, complete project management tools, and reporting environment to help address these challenges. The presentation includes a demonstration of Project Server 2010 and takes away points about the significant challenges, how proper management is essential, and how Project Server 2010 can help with a no-code solution.
MSTP divides a bridged network into multiple regions called MST regions. Within each region, multiple RSTP instances called MSTIs are enabled to map VLANs and build separate spanning trees. A representative bridge in each region communicates with representatives of other regions to form a common spanning tree (CST) that connects all the MST regions as a single spanning tree across the entire network.
MPLS WC 2014 Segment Routing TI-LFA Fast ReRouteBruno Decraene
This document discusses Topology Independent LFA (TI-LFA), a fast reroute technique that provides 100% node and link protection using Segment Routing. It begins by outlining requirements for fast reroute, then introduces TI-LFA which computes the post-convergence path and encodes it as a loop-free Segment Routing path. The document analyzes applicability on Orange network topologies and presents simulation results showing TI-LFA achieves low stack depth and path compression. It concludes that TI-LFA is a scalable solution that meets requirements by providing optimal fast reroute paths without side effects.
Open Shortest Path First (OSPF) is an interior gateway protocol that uses link state routing and the Dijkstra algorithm to calculate the shortest path to destinations within an autonomous system. It elects a Designated Router to generate network link advertisements and assist in database synchronization between routers. Routers run the Shortest Path First algorithm on their link state databases to determine the best routes and populate their routing tables.
Access control lists (ACLs) are used to control network traffic flows between routers by filtering packets. Standard ACLs filter based on source IP address and block bidirectional traffic. Extended ACLs filter on source IP address, destination IP address, protocol and port, and can block traffic in one direction only. Wildcard masks are used in ACLs to specify which IP address bits must match for the ACL entry to apply.
Segment routing is a technology that is gaining popularity as a way to simplify MPLS networks. It has the benefits of interfacing with software-defined networks and allows for source-based routing. It does this without keeping state in the core of the network and needless to use LDP and RSVP-TE.
The document discusses using Iperf to measure network performance. Iperf can measure both TCP and UDP throughput. For TCP, it measures achievable bandwidth including the impact of the end systems. UDP provides more transparency and can directly measure loss and jitter. The document provides examples of invoking Iperf for TCP and UDP tests and discusses how to adjust settings like buffer size to optimize performance. It also describes how to use Iperf to generate high bandwidth streams and cautions against misusing it to overload networks.
The omega network is a type of banyan multistage interconnection network that uses a "perfect shuffle" interconnection pattern between stages. Cells in the omega network self-route to their destination port by examining the bit at each stage. However, like the delta network, the omega network suffers from path and output contention which can degrade performance. A Batcher sorter can be used before the omega network to sort cells by destination port, eliminating contention.
The document provides information about Zenith Networks and Juniper Networks. Zenith Networks is a partner of Juniper Networks and has over 27 years of experience providing network integration and education services. It focuses on routing, switching, security and configuration/design of LAN/WAN networks. Juniper Networks was founded in 1996 and has over 9,400 employees across 46 countries. It is known for its routing, switching and security products and connects networks around the world.
This document provides an overview of IPv6, including:
- The need for IPv6 due to the depletion of IPv4 addresses and limitations of IPv4's classful addressing.
- Techniques used to extend IPv4 like subnetting, CIDR, and NAT.
- Key features of IPv6 like its larger 128-bit address space, stateless autoconfiguration, and security improvements.
- Differences between IPv4 and IPv6 headers and IPv6's use of extension headers.
- The presentation concludes that IPv6 builds upon IPv4's foundations but addresses its limitations.
Segment Routing Advanced Use Cases - Cisco Live 2016 USAJose Liste
The document discusses segment routing and its use for inter-domain connectivity at scale. Segment routing allows source routing by encoding a path as an ordered list of segments in packet headers. It can be used to interconnect massive-scale datacenters and networks with hundreds of thousands of nodes. Segment routing scales through the use of globally unique prefix segments, redistribution of routing information only from the core to edges, and segment routing path computation elements. The path computation elements use segment routing native algorithms to optimize paths while maintaining equal-cost multipath routing.
The document discusses Advanced eXtensible Interface (AXI), which is a third generation interface specification that is targeted at high performance systems. AXI uses separate address/control and data phases to improve performance. It supports burst transactions where only the start address is issued and multiple outstanding addresses can be in flight simultaneously. AXI consists of five channels to separate read and write operations. Simulation results showed that AXI provides higher throughput than older AMBA interfaces, though older interfaces may have lower latency in some cases. AXI's standardization and flexibility make it useful for integrating IP cores.
1) The document provides an overview of IPv6 including why it was developed, its key features and improvements over IPv4 such as a vastly larger address space, more efficient routing and security features built into the protocol.
2) It describes IPv6 addressing in detail including the different address types (unicast, multicast, anycast), address formats, interface identifiers and address autoconfiguration.
3) The header format, extension headers for optional information, and new fields for quality of service and flow identification are explained in comparison to IPv4.
4) Protocols for neighbor discovery, multicast listener discovery, and address resolution that replace functions in IPv4 are outlined.
This document outlines the TCP/IP protocol stack including the TCP, IP, and Ethernet headers. It describes TCP/IP as an industry standard communication protocol consisting of four layers - application, transport, internet, and network interface. The document also briefly mentions UDP format and provides an overview of the information contained in TCP, IP, and Ethernet headers.
This document discusses configuring a Cisco router to act as a DHCP server. It describes the steps to create DHCP pools for two networks, 10.10.10.0/24 and 20.20.20.0/24, and configure the router's interfaces. It also explains the DHCP process and provides configuration snippets from the router to illustrate excluding addresses and verifying the configuration. The goal is to prepare readers for the Cisco CCNA certification exam.
This study guide is intended to provide those pursuing the CCNA certification with a framework of what concepts need to be studied. This is not a comprehensive document containing all the secrets of the CCNA, nor is it a “braindump” of questions and answers.
I sincerely hope that this document provides some assistance and clarity in your studies.
John Aynsley provides an in-depth overview of advanced UVM concepts including sequences and sequencers, virtual sequences, layered sequencers for request-response transactions, and strategies for synchronizing multiple sequencer stacks. The document discusses techniques for modeling pipelined interfaces, out-of-order responses, and idle cycles in a driver. It also examines the arbitration queue, user-defined arbitration algorithms, locking versus grabbing sequences, and using events to synchronize different components.
The document discusses various data structures and functions related to network packet processing in the Linux kernel socket layer. It describes the sk_buff structure that is used to pass packets between layers. It also explains the net_device structure that represents a network interface in the kernel. When a packet is received, the interrupt handler will raise a soft IRQ for processing. The packet will then traverse various protocol layers like IP and TCP to be eventually delivered to a socket and read by a userspace application.
This study guide is intended to provide those pursuing the CCNA certification with a framework of what concepts need to be studied. This is not a comprehensive document containing all the secrets of the CCNP nor is it a “braindump” of questions and answers.
I sincerely hope that this document provides some assistance and clarity in your studies.
Why you should be excited about ClojureScriptelliando dias
ClojureScript allows Clojure code to compile to JavaScript. Created by Rich Hickey and friends, it provides optimizations for performance while maintaining readability and abstraction. As a Lisp for JavaScript, ClojureScript controls complexity on the web and benefits from JavaScript's status as a compilation target for many languages.
SharePoint Governance and Lifecycle Management with Project Server 2010Alexander Burton
This document summarizes a presentation about using Project Server 2010 to help manage SharePoint governance and lifecycles. It discusses typical IT challenges with managing business requests, and how Project Server 2010 provides a project request and tracking framework, project selection tools, complete project management tools, and reporting environment to help address these challenges. The presentation includes a demonstration of Project Server 2010 and takes away points about the significant challenges, how proper management is essential, and how Project Server 2010 can help with a no-code solution.
This document provides an index for the topics that will be covered in an Advanced Java Programming course, including Java Database Connectivity (JDBC), Java Servlets, multi-threaded programming, applets, Java network programming, Java Server Pages (JSP), Java Beans and Swing, frameworks like Spring and Hibernate, and Java development best practices. The index lists 9 main chapters that will cover technologies, architectures, life cycles, examples and test papers for each topic.
This document provides an outline and details for a course on Internet Programming. It includes sections on course details, programming and the web, programming versus scripting, serving HTML pages, web servers, accessing databases, web applications, Ajax, HTML tags, and references. The lecturer is Eng. Mohammed Hussein from Thamar University in Yemen.
O documento discute sistemas de automação industrial, desde sistemas manuais até sistemas automatizados. Detalha os principais componentes de sistemas automatizados, incluindo sensores, atuadores e controladores lógicos programáveis, e explica conceitos básicos de controle de processo como malha aberta vs malha fechada.
This document contains information about TCP/IP sockets and network programming in C, including:
1) It defines the sockaddr_in structure for IPv4 socket addressing with fields for the address family, port number, and 32-bit IPv4 address.
2) It describes the basic socket calls like socket(), bind(), listen(), accept(), connect(), read(), write(), and close() used for network programming.
3) It provides code examples for a simple TCP echo client and server to illustrate how these socket calls are used for communication between networked applications.
Introduction to visual basic programmingRoger Argarin
The document outlines a course on Visual Basic programming using Visual Studio .NET2005. It introduces Visual Basic and its history, covers basic concepts like object-oriented programming and event-driven programming. It describes setting up the Visual Studio development environment and how to plan and create Visual Basic projects using forms, controls, properties, and code. References and resources are provided to learn more about Visual Basic and .NET programming.
Sockets provide an interface between applications and the network. An application creates a socket which can be either connection-oriented or connectionless. The socket type determines the communication style. Once configured, the application can send and receive data through the socket to communicate over the network. There are two main socket types - SOCK_STREAM for reliable connections and SOCK_DGRAM for unreliable datagrams. Socket addresses contain the IP address and port number to identify the endpoint of communication.
The document discusses network programming with sockets. It outlines basic socket programming concepts like client-server models, TCP and UDP services, and BSD sockets. It then describes key socket functions for creation and setup, establishing connections, sending/receiving data, and tearing down connections.
The document discusses the TCP/IP protocol suite and its layers - application, transport, internet and link layer. It describes the functionality of each layer and the data encapsulation between layers. It also discusses protocols like TCP, UDP, IP, ICMP and their usage. Network concepts like routers, bridges, classes of networks and sockets are explained along with examples.
When we desire a communication between two applications possibly running on different machines, we need sockets. This presentation aims to provide knowledge of basic socket programming to undergraduate students. Basically, this presentation gives the importance of socket in the area of networking and Unix Programming. The presentation of Topic (Sockets) has designed according to the Network Programming Subject, B.Tech, 6th Semester syllabus of Punjab Technical University Kapurthala, Punjab.
Socket programming allows processes to communicate over a network. Key aspects include:
- Demultiplexing packets into processes using port numbers
- Converting between host and network byte order
- Sockets representing an endpoint for communication and identified by address/port pairs
- Functions for binding addresses, listening for connections, accepting connections, and sending/receiving data over established sockets.
This document provides an introduction to socket programming in C on Linux. Some key points:
- Sockets allow communication between processes over a network and act as an interface between applications and the network. They are represented by file descriptors.
- There are two main types of sockets - stream sockets (TCP) which provide reliable, ordered data transmission and datagram sockets (UDP) which are unreliable but do not require a connection.
- The socket API includes functions like socket(), bind(), listen(), accept(), connect(), recv(), send(), etc. to create and manage sockets and network communication.
- Data structures like sockaddr_in are used to store socket addresses containing IP and port. Byte ordering functions like
The document provides an overview of sockets and network programming in 3 paragraphs:
1) It introduces sockets as endpoints for connections between processes, with the socket represented by a descriptor integer. It describes how applications interface with sockets and the transport layer protocols like TCP and UDP.
2) It explains how connections between endpoints are defined by the host address (IP address) and port number. It provides details on port numbers and common port usages.
3) It outlines the main network transport protocols TCP and UDP, describing TCP as reliable and connection-based while UDP is unreliable and connectionless. It shows the typical client-server model using TCP.
Introduction
This Tutorial is On Socket Programming In C Language for Linux. Instructions Give Below will only work On Linux System not in windows.
Socket API In windows is called Winsock and there we can discuss about that in another tutorial.
What is Socket?
Sockets are a method for communication between a client program and a server program in a network.
A socket is defined as "the endpoint in a connection." Sockets are created and used with a set of programming requests or "function calls" sometimes called the sockets application programming interface (API).
The most common sockets API is the Berkeley UNIX C interface for sockets.
Sockets can also be used for communication between processes within the same computer.
Byte ordering refers to the ordering of bytes in memory for numeric values. There are two types: network byte ordering stores the most significant byte at the lowest memory address, while host byte ordering is the opposite. Sockets provide an interface between processes and the transport layer, allowing processes to communicate over a network. Common socket types are stream sockets for reliable connected communication using TCP and datagram sockets for unreliable communication using UDP. Functions like bind(), listen(), accept(), send(), and recv() are used to set up and communicate over sockets.
This document discusses sockets and their use in networking applications. It begins with an overview of sockets, including that they provide an endpoint for network connections and are identified by both an IP address and port number. It then covers socket details for TCP and UDP, such as how TCP provides reliable connections while UDP is connectionless. The document concludes with examples of TCP and UDP client-server code using common socket functions like bind(), listen(), accept(), connect(), send(), and recv().
The document provides information about the CO5I Advanced Computer Network course, including:
- The course vision is to develop professionals with technical skills and ethical values to serve society.
- The course objectives are to impart technical knowledge, provide strong practical and theoretical skills in computer engineering, and develop necessary skills and ethics in students.
- The course outcomes include implementing various network layer, transport layer, and application layer protocols.
- The document lists several experiments related to networking concepts that students will perform, including subnetting, IPv6 configuration, routing protocols, and application layer protocols.
Chapter VI of Networking talks about IP protocol & Routing. It also covers aspects of socket programming used for converting servers into Linux Daemons.
This document provides an overview of common Linux networking commands such as ifconfig, route, traceroute, nslookup, arp, dig, and netstat that are used to configure network interfaces, display routing tables, trace network routes, lookup domain names, manage address resolution, query DNS servers, and view network statistics. It also discusses how to use ifconfig to assign IP addresses to interfaces, route to view routing tables, arp to manage the address resolution cache, and dig for more powerful DNS lookups than nslookup.
This document discusses network considerations for Real Application Clusters (RAC). It describes the different network types used, including public, private, storage, and backup networks. It discusses protocols like TCP and UDP used for different traffic. It also covers concepts like network architecture, layers, MTU, jumbo frames, and tools for monitoring network performance like netstat, ping, and traceroute.
This presentation introduces Data Plane Development Kit overview and basics. It is a part of a Network Programming Series.
First, the presentation focuses on the network performance challenges on the modern systems by comparing modern CPUs with modern 10 Gbps ethernet links. Then it touches memory hierarchy and kernel bottlenecks.
The following part explains the main DPDK techniques, like polling, bursts, hugepages and multicore processing.
DPDK overview explains how is the DPDK application is being initialized and run, touches lockless queues (rte_ring), memory pools (rte_mempool), memory buffers (rte_mbuf), hashes (rte_hash), cuckoo hashing, longest prefix match library (rte_lpm), poll mode drivers (PMDs) and kernel NIC interface (KNI).
At the end, there are few DPDK performance tips.
Tags: access time, burst, cache, dpdk, driver, ethernet, hub, hugepage, ip, kernel, lcore, linux, memory, pmd, polling, rss, softswitch, switch, userspace, xeon
This document provides an overview of socket basics, including how sockets provide an endpoint for network connections and are identified by an IP address and port number. It describes the key functions for creating, binding, listening for, and accepting TCP and UDP sockets. TCP provides a reliable connected service while UDP is unreliable and connectionless. Port numbers and common services are also outlined.
The document discusses various socket programming concepts including:
1) Value-result arguments and how data is passed between the process and kernel for socket functions.
2) Byte ordering issues that can occur when transferring multi-byte data types between systems of different architectures. Functions like htonl and ntohl are used to convert between host and network byte ordering.
3) Other functions related to byte manipulation, address conversion, and reading/writing to sockets.
The document discusses Berkeley socket network programming in TCP. It covers how to create server and client sockets in TCP, including the socket(), bind(), listen(), accept(), and connect() functions. It also covers converting between host and network byte order, socket options like SO_REUSEADDR, and the TCP connection states including TIME_WAIT.
ClojureScript allows developers to use the Clojure programming language to build applications that compile to JavaScript. This enables Clojure code to run in environments where JavaScript is supported, like web browsers and mobile apps. ClojureScript leverages the Google Closure compiler and library to provide whole program optimization of Clojure code compiling to JavaScript.
Functional Programming with Immutable Data Structureselliando dias
1. The document discusses the advantages of functional programming with immutable data structures for multi-threaded environments. It argues that shared mutable data and variables are fundamentally flawed concepts that can lead to bugs, while immutable data avoids these issues.
2. It presents Clojure as a functional programming language that uses immutable persistent data structures and software transactional memory to allow for safe, lock-free concurrency. This approach allows readers and writers to operate concurrently without blocking each other.
3. The document makes the case that Lisp parentheses in function calls uniquely define the tree structure of computations and enable powerful macro systems, homoiconicity, and structural editing of code.
O documento lista e descreve as principais partes de um contêiner de carga seco, incluindo o painel frontal, laterais, traseira, teto, piso e estrutura inferior. Muitos componentes como painéis laterais, travessas do teto e fundo são numerados de acordo com sua localização. As portas traseiras contêm quadros, painéis, dobradiças e barras de fechamento.
O documento discute a história da geometria projetiva, desde Euclides até seu uso em computação gráfica. Aborda figuras-chave como Pascal, que foi pioneiro na área, e como a perspectiva foi aplicada nas artes ao longo dos séculos.
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
This document discusses the benefits of polyglot and poly-paradigm programming approaches for building more agile applications. It describes how using multiple languages and programming paradigms can optimize both performance and developer productivity. Specifically, it suggests that statically-typed compiled languages be used for core application components while dynamically-typed scripting languages connect and customize these components. This approach allows optimizing areas that require speed/efficiency separately from those requiring flexibility. The document also advocates aspects and functional programming to address cross-cutting concerns and concurrency challenges that arise in modern applications.
This document discusses JavaScript libraries and frameworks. It provides an overview of some popular options like jQuery, Prototype, Dojo, MooTools, and YUI. It explains why developers use libraries, such as for faster development, cross-browser compatibility, and animation capabilities. The document also discusses how libraries resemble CSS and use selector syntax. Basic examples are provided to demonstrate common tasks like hover effects and row striping. Factors for choosing a library are outlined like maturity, documentation, community, and licensing. The document concludes by explaining how to obtain library code from project websites or Google's AJAX Libraries API.
How to Make an Eight Bit Computer and Save the World!elliando dias
This document summarizes a talk given to introduce an open source 8-bit computer project called the Humane Reader. The talk outlines the goals of providing a cheap e-book reader and computing platform using open source tools. It describes the hardware design which uses an AVR microcontroller and interfaces like video output, SD card, and USB. The talk also covers using open source tools for development and sourcing low-cost fabrication and assembly. The overall goals are to create an inexpensive device that can provide educational resources in developing areas.
Ragel is a parser generator that compiles to various host languages including Ruby. It is useful for parsing protocols and data formats and provides faster parsing than regular expressions or full LALR parsers. Several Ruby projects like Mongrel and Hpricot use Ragel for tasks like HTTP request parsing and HTML parsing. When using Ragel with Ruby, it can be compiled to Ruby code directly, which is slow, or a C extension can be written for better performance. The C extension extracts the parsed data from Ragel and makes it available to Ruby.
A Practical Guide to Connecting Hardware to the Webelliando dias
This document provides an overview of connecting hardware devices to the web using the Arduino platform. It discusses trends in electronics and computing that make this easier, describes the Arduino hardware and software, and covers various connection methods including directly to a computer, via wireless modems, Ethernet shields, and services like Pachube that allow sharing sensor data over the internet. The document aims to demonstrate how Arduinos can communicate with other devices and be used to build interactive systems.
O documento introduz o Arduino, uma plataforma de desenvolvimento open-source. Discute as características e componentes do Arduino, incluindo microcontroladores, software e exemplos de código. Também fornece instruções básicas sobre como programar o Arduino usando linguagem C.
O documento apresenta um mini-curso introdutório sobre Arduino, abordando o que é a plataforma Arduino, como é estruturado seu hardware, como programá-lo, exemplos básicos de código e aplicações possíveis como controle residencial e robótica.
The document discusses various functions for working with datasets in the Incanter library for Clojure. It describes how to create, read, save, select rows and columns from, and sort datasets. Functions are presented for building datasets from sequences, reading datasets from files and URLs, saving datasets to files and databases, selecting single or multiple columns, and filtering rows based on conditions. The document also provides an overview of the Incanter library and its various namespaces for statistics, charts, and other functionality.
Rango is a lightweight Ruby web framework built on Rack that aims to be more robust than Sinatra but smaller than Rails or Merb. It is inspired by Django and Merb, uses Ruby 1.9, and supports features like code reloading, Bundler, routing, rendering, and HTTP error handling. The documentation provides examples and details on using Rango.
Fab.in.a.box - Fab Academy: Machine Designelliando dias
This document describes the design of a multifab machine called MTM. It includes descriptions of the XY stage and Z axis drive mechanisms, as well as the tool heads and network used to control the machine. Key aspects of the design addressed include the stepper motor selection, drive electronics, motion control firmware, and use of a virtual machine environment and circular buffer to enable distributed control of the machine. Strengths of the design include low inertia enabling high acceleration, while weaknesses include low basic resolution and stiffness unsuitable for heavy milling.
The Digital Revolution: Machines that makeselliando dias
The document discusses the results of a study on the effects of a new drug on memory and cognitive function in older adults. The double-blind study involved giving either the new drug or a placebo to 100 volunteers aged 65-80 over a 6 month period. Testing showed those receiving the drug experienced statistically significant improvements in short-term memory retention and processing speed compared to the placebo group.
The document discusses using Clojure for Hadoop programming. Clojure is a dynamic functional programming language that runs on the Java Virtual Machine. The document provides an overview of Clojure and how its features like immutability and concurrency make it well-suited for Hadoop. It then shows examples of implementing Hadoop MapReduce jobs using Clojure by defining mapper and reducer functions.
This document provides an overview of Hadoop, including:
1) Hadoop solves the problems of analyzing massively large datasets by distributing data storage and analysis across multiple machines to tolerate node failure.
2) Hadoop uses HDFS for distributed data storage, which shards massive files across data nodes with replication for fault tolerance, and MapReduce for distributed data analysis by sending code to the data.
3) The document demonstrates MapReduce concepts like map, reduce, and their composition with an example job.
Hadoop and Hive Development at Facebookelliando dias
Facebook generates large amounts of user data daily from activities like status updates, photo uploads, and shared content. This data is stored in Hadoop using Hive for analytics. Some key facts:
- Facebook adds 4TB of new compressed data daily to its Hadoop cluster.
- The cluster has 4800 cores and 5.5PB of storage across 12TB nodes.
- Hive is used for over 7500 jobs daily and by around 200 engineers/analysts monthly.
- Performance improvements to Hive include lazy deserialization, map-side aggregation, and joins.
Multi-core Parallelization in Clojure - a Case Studyelliando dias
The document describes a case study on using Clojure for multi-core parallelization of the K-means clustering algorithm. It provides background on parallel programming concepts, an introduction to Clojure, and details on how the authors implemented a parallel K-means algorithm in Clojure using agents and software transactional memory. They present results showing speedups from parallelization and accuracy comparable to R's implementation on both synthetic and real-world datasets.
From Lisp to Clojure/Incanter and RAn Introductionelliando dias
This document provides a comparison between the statistical computing languages R and Clojure/Incanter. It discusses the histories and philosophies behind Lisp, Fortran, R and Clojure. Key differences noted are that Clojure runs on the Java Virtual Machine, allowing it to leverage Java libraries, while R is primarily written in C and Fortran. Incanter is presented as a Clojure-based platform for statistical computing and graphics that is more immature than R but allows easier access to Java capabilities. Basic syntax comparisons are provided.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Zilliz
Join us to introduce Milvus Lite, a vector database that can run on notebooks and laptops, share the same API with Milvus, and integrate with every popular GenAI framework. This webinar is perfect for developers seeking easy-to-use, well-integrated vector databases for their GenAI apps.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
2. • Socket Options • Posix name/address conversion
• Out-of-Band Data • Signal Driven I/O
• It's important to know about some of these
topics, although it might not be apparent
how and when to use them.
• Details are in the book - we are just trying
to get some idea of what can be done.
2
3. Socket Options
• Various attributes that are used to determine
the behavior of sockets.
• Setting options tells the OS/Protocol Stack
the behavior we want.
• Support for generic options (apply to all
sockets) and protocol specific options.
3
4. Option types
• Many socket options are boolean flags
indicating whether some feature is enabled
(1) or disabled (0).
• Other options are associated with more
complex types including int,
timeval, in_addr, sockaddr, etc.
• Some options are readable only (we can’t
set the value).
4
5. Setting and Getting option values
getsockopt() gets the current value of a
socket option.
setsockopt() is used to set the value of a
socket option.
5
6. int getsockopt( int sockfd,
int level,
int optname,
void *opval,
socklen_t *optlen);
level specifies whether the option is a
general option or a protocol specific option
(what level of code should interpret the
option).
6
7. int setsockopt( int sockfd,
int level,
int optname,
const void *opval,
socklen_t optlen);
level specifies whether the option is a
general option or a protocol specific option
(what level of code should interpret the
option).
7
8. General Options
• Protocol independent options.
• Handled by the generic socket system code.
• Some options are supported only by specific
types of sockets (SOCK_DGRAM,
SOCK_STREAM).
8
10. SO_BROADCAST
• Boolean option: enables/disables sending of
broadcast messages.
• Underlying DL layer must support
broadcasting!
• Applies only to SOCK_DGRAM sockets.
• Prevents applications from inadvertently
sending broadcasts (OS looks for this flag
when broadcast address is specified).
10
12. SO_ERROR
• Integer value option.
• Value is an error indicator value as used by
errno.
• Readable (get’able) only!
• Reading (by calling getsockopt())
clears any pending error.
12
13. SO_KEEPALIVE
• Boolen option: enabled means that
STREAM sockets should send a probe to
peer if no data flow for a “long time”.
• Used by TCP - allows a process to
determine whether peer process/host has
crashed.
• Consider what would happen to an open
telnet connection without keepalive.
13
14. SO_LINGER
• Value is:
struct linger {
int l_onoff; /* 0 = off */
int l_linger; /* time in seconds */
};
• Used to control whether and how long a call
to close will wait for pending ACKS.
• connection-oriented sockets only.
14
15. SO_LINGER
• By default, calling close() on a TCP
socket will return immediately.
• The closing process has no way of knowing
whether or not the peer received all data.
• Setting SO_LINGER means the closing
process can determine that the peer machine
has received the data (but not that the data
has been read() !).
15
16. SO_RCVBUF
SO_SNDBUF
• Integer values options - change the receive
and send buffer sizes.
• Can be used with STREAM and DGRAM
sockets.
• With TCP, this option effects the window
size used for flow control - must be
established before connection is made.
16
17. SO_REUSEADDR
• Boolean option: enables binding to an
address (port) that is already in use.
• Used by servers that are transient - allows
binding a passive socket to a port currently
in use (with active sockets) by other
processes.
• Can be used to establish separate servers for
the same service on different interfaces (or
different IP addresses on the same interface) 17
18. IP Options (IPv4)
• IP_HDRINCL: used on raw IP sockets
when we want to build the IP header
ourselves.
• IP_TOS: allows us to set the “Type-of-
service” field in an IP header.
• IP_TTL: allows us to set the “Time-to-live”
field in an IP header.
18
19. TCP socket options
• TCP_KEEPALIVE: set the idle time used
when SO_KEEPALIVE is enabled.
• TCP_MAXSEG: set the maximum segment
size sent by a TCP socket.
• TCP_NODELAY: can disable TCP’s Nagle
algorithm that delays sending small packets
if there is unACK’d data pending.
19
20. • This was just an overview
– there are many details associated with the
options described.
– There are many options that haven’t been
described.
20
21. Posix Name/Adress Conversion
• We've seen gethostbyname and
gethostbyaddr - these are protocol
dependent.
– Not part of sockets library.
• Posix includes protocol independent
functions:
getaddrinfo() getnameinfo()
21
22. getaddrinfo, getnameinfo
• These functions provide name/address
conversions as part of the sockets library.
• In the future it will be important to write
code that can run on many protocols (IPV4,
IPV6), but for now these functions are not
widely available.
– It's worth seeing how they work even though
we probably can't use them yet!
22
23. getaddrinfo()
• Puts protocol dependence in library (where
it belongs).
– Same code can be used for many protocols, we
will see examples when we talk about IPV6
– re-entrant function - gethostbyname is not!
• Important to threaded applications.
23
24. getaddrinfo()
int getaddrinfo(
const char *hostname,
const char *service,
const struct addrinfo* hints,
struct addrinfo **result);
getaddrinfo() replaces both gethostbyname()
and getservbyname()
24
25. getaddrinfo()
Hostname is a hostname or an address string (dotted
decimal string for IP).
Service is a service name or a decimal port number
string.
25
26. struct addrinfo
struct addrinfo {
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
size_t ai_addrlen;
li st!
char *canonname; ed
struct sockaddr *ai_addr; L ink
struct addrinfo *ai_next;
};
26
27. getaddrinfo()
hints is an addrinfo * (can be NULL) that can
contain:
– ai_flags (AI_PASSIVE , AI_CANONNAME )
– ai_family (AF_XXX )
– ai_socktype (SOCK_XXX )
– ai_protocol (IPPROTO_TCP, etc.)
27
28. getaddrinfo
result is returned with the address of a pointer to
an addrinfo structure that is the head of a
linked list.
It is possible to get multiple structures:
– multiple addresses associated with the hostname.
– The service is provided for multiple socket types.
28
29. addrinfo usage
ai_flags Used in call to socket()
ai_family
ai_socktype
ai_protocol Used in call to bind(), connect()
ai_addrlen or sendto()
ai_canonname
ai_addr
ai_next
ai_flags
ai_family
ai_socktype
ai_protocol
ai_addrlen
ai_canonname
ai_addr
ai_next
29
30. getnameinfo()
int getnameinfo(
const struct sockaddr *sockaddr,
socklen_t addrlen
char *host,
size_t hostlen,
char *serv,
size_t servlen,
int flags);
getnameinfo() looks up a hostname and a service
name given a sockaddr
30
31. Out-of-Band Date
• Ever been on a date, gone to a dance club
and the band doesn't show up?
– This is becoming a serious problem:
• The number of Internet dating services is growing
exponentially.
• The number of bands is not growing.
– RFC 90210 proposes some short term solutions
(until the number of bands can be increased).
31
32. Out-of-Band Data
• TCP (and other transport layers) provide a
mechanism for delivery of quot;high priorityquot;
data ahead of quot;normal dataquot;.
• We can almost think of this as 2 streams:
normal data
TCP PORT TCP PORT
A B
special data
32
33. TCP OOB Data
• TCP supports something like OOB data
using URGENT MODE (a bit is send in a
TCP segment header).
• A TCP segment header field contains an
indication of the location of the urgent data
in the stream (the byte number).
• The details are not important to us (we just
want to see how to use this in our program).
33
34. Sending OOB Data
send(sd,buff,1,MSG_OOB);
Can use send() to put a single byte of urgent data in a
TCP stream.
The TCP layer adds some segment header info to let
the other end know there is some OOB data.
The TCP layer on the receiving end treats the data
marked as urgent in a special way.
34
35. Receiving OOB Data
• The TCP layer generates a SIGURG signal
in the receiving process.
• Select() will tell you an exception
condition is present.
• Depending on how things are set up:
– the data can be read using recv() with a
MSG_OOB flag set.
– The data can be read inline and the receiving
process can moniter the out-of-band-mark for
the connection (using sockatmark())
35
36. So what?
• OOB Data might be used:
– a heartbeat between the client and server to
detect early failure (example in the book).
– A way to communicate an exceptional
condition to a peer even when flow control has
stopped the sender.
36
37. Singles Driven IOU
• Another problem with Internet Dating
services is the lack of single drivers in many
metropolitan areas.
– Neither participant can pick up the other.
– Dating protocols degrade to involve online
communication only.
– Proxy drivers (running TAXI protocol) get
overloaded and refuse IOU packets.
37
38. Signal Driven I/O
• We can tell the kernel to send a SIGIO
signal whenever something happens to a
socket descriptor.
• The signal handler must determine what
conditions caused the signal and take
appropriate action.
38
39. Signal Driven UDP
• SIGIO occurs whenever:
– an incoming datagram arrives.
– An asynchronous error occurs.
• Could be ICMP error (unreachable, invalid address,
etc).
• Could allow process to handle other tasks
and still watch for incoming UDP messages.
39
40. Signal Driven TCP
• SIGIO occurs whenever:
– an incoming connection has completed.
– Disconnect request initiated.
– Disconnect request completed.
– Half a connection shutdown.
– Data has arrived.
– Data has been sent (indicating there is buffer space)
– asynchronous error
40