Unix Network Programming Episode 9

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/myfather103/article/details/80835839

Given the interface names, we execute ifconfig to obtain the details for each interface.

luxuan@ubuntu:~$ ifconfig ens38
ens38: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.102.129  netmask 255.255.255.0  broadcast 192.168.102.255
        inet6 fe80::625d:6d8:8a09:67c  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:0a:39:d9  txqueuelen 1000  (Ethernet)
        RX packets 111  bytes 9869 (9.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 319  bytes 30561 (30.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

One way to find the IP address of many hosts on the local network is to ping the broadcast address (which we found in the previous step).

It is quite common so I won’t show it.

Unix Standards

At the time of this writing, the most interesting Unix standardization activity was being done by The Austin Common Standards Revision Group (CSRG). Their efforts have produced roughly 4,000 pages of specifications covering over 1,700 programming interfaces. These specifications carry both the IEEE POSIX designation as well as The Open Group’s Technical Standard designation. The net result is that you’ll likely encounter references to the same standard by various names: ISO/IEC 9945:2002, IEEE Std 1003.1-2001, and the Single Unix Specification Version 3, for example. In this text, we will refer to this standard as simply The POSIX Specification, except in sections like this one where we are discussing specifics of various older standards.

Background on POSIX

POSIX is an acronym for Portable Operating System Interface. POSIX is not a single standard, but a family of standards being developed by the Institute for Electrical and Electronics Engineers, Inc., normally called the IEEE. The POSIX standards have also been adopted as international standards by ISO and the International Electrotechnical Commission (IEC), called ISO/IEC. The POSIX standards have an interesting history, which we cover only briefly here:

  • IEEE Std 1003.1–1988 (317 pages) was the first POSIX standard.

  • IEEE Std 1003.1–1990 (356 pages) was next, and it was also known as ISO/IEC 9945–1: 1990.

  • IEEE Std 1003.2–1992 came next in two volumes (about 1,300 pages).

  • IEEE Std 1003.1b–1993 (590 pages) was originally known as IEEE P1003.4.

  • IEEE Std 1003.1, 1996 Edition [IEEE 1996] (743 pages) came next and included 1003.1–1990 (the base API), 1003.1b–1993 (real-time extensions), 1003.1c–1995 (pthreads), and 1003.1i–1995 (technical corrections to 1003.1b). This standard was also called ISO/IEC 9945–1: 1996.

  • This standard also contains a Foreword stating that ISO/IEC 9945 consists of the following parts:

    • Part 1: System API (C language)
    • Part 2: Shell and utilities
    • Part 3: System administration (under development)
  • IEEE Std 1003.1g: Protocol-independent interfaces (PII) became an approved standard in 2000. Until the introduction of The Single Unix Specification Version 3, this POSIX work was the most relevant to the topics covered in this book. This is the networking API standard and it defines two APIs, which it calls Detailed Network Interfaces (DNIs):

1.DNI/Socket, based on the 4.4BSD sockets API
2.DNI/XTI, based on the X/Open XPG4 specification

Background on The Open Group

The Open Group was formed in 1996 by the consolidation of the X/Open Company (founded in 1984) and the Open Software Foundation (OSF, founded in 1988). It is an international consortium of vendors and end-user customers from industry, government, and academia. Here is a brief background on the standards they produced:

  • X/Open published the X/Open Portability Guide, Issue 3 (XPG3) in 1989.
  • Issue 4 was published in 1992, followed by Issue 4, Version 2 in 1994.
  • In March 1997, Version 2 of the Single Unix Specification was announced. Products conforming to this specification were called “Unix 98.”

Unification of Standards

The above brief backgrounds on POSIX and The Open Group both continue with The Austin Group’s publication of The Single Unix Specification Version 3, as mentioned at the beginning of this section. Getting over 50 companies to agree on a single standard is certainly a landmark in the history of Unix. Most Unix systems today conform to some version of POSIX.1 and POSIX.2; many comply with The Single Unix Specification Version 3.

猜你喜欢

转载自blog.csdn.net/myfather103/article/details/80835839
今日推荐