comp.lang.ada
 help / color / mirror / Atom feed
* AI12-0218:  What is the portable representation clause for processing IETF packets on little-endian machines?
@ 2018-05-10 17:45 Dan'l Miller
  2018-05-10 19:24 ` Dan'l Miller
                   ` (4 more replies)
  0 siblings, 5 replies; 63+ messages in thread
From: Dan'l Miller @ 2018-05-10 17:45 UTC (permalink / raw)


It seems that 2 major use-cases of AI12-0218 are getting short shrift.

http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0218-1.txt?rev=1.3&raw=N

USE-CASE:  network byte order:
1) Nearly all telecom protocols operate on big-endian octet ordering.  Big-endian octet ordering in all the Internet protocols' packet formats is so common that IETF calls it “network byte ordering”.  Conversely, the 3 most widely deployed ISAs on the planet (i.e., IA-32, AMD64, ARM*) are all little-endian.  This matters not for line-rate packets and frames processed by ASICs or FPGAs or DSPs, but for the packets whose processing is at software speed in general-purpose processors, byte-swapping is what makes the Internet work on the computer that you are using right this instant (unless you are using a PowerPC-, POWER, 68K-, MIPS, or mainframe-based computer or an Alpha- or Itanium-based computer configured in the rare big-endian configuration).  So this is not a rare use-case at all!

* Like many RISC processors, endianness is a choice at PCB engineering-time.  The vast vast majority of ARM-based designs choose little-endian.

Instead of the use-case being rare, what is apparently rare is for Ada to be utilized to write such network-protocol software on Intel and ARM processors instead of C or C++.  Most of the military uses PowerPC as their general-purpose processors, and rarely ARM and even rarer Intel.

USE-CASE:  memory-mapped registers on peripheral ICs:
2) When writing device drivers for many ICs, the IC's register set often is memory-mapped at a fixed address.  This IC has either big-endian or little-endian octet ordering.  The general-purpose processor is either big-endian or little-endian.  Often ICs from big-endian manufacturers are utilized on processors that are little-endian.  Often ICs from little-endian manufacturers are utilized on processors that are big-endian.  Sometimes endianness is configurable in those ICs; often it is not.

So in AI12-0218 when I see resistance of ARG members to standardizing a widespread use-case that was (in the 1970s-/1980s-/1990s-era Ada-is-the-future mantra) supposed to be Ada's sweet-spot (i.e., writing device drivers portably), I can see one crucial reason that Ada was frowned upon in writing packet-processing and device-driver software an Intel and ARM platforms, which are the most popular by far of all ISAs.

Little-endian platforms (who need byte-swapping for network byte order):
all Apple iOS devices, all ARM-based Android devices, all Windows 10 computers, all Windows 8.1 computers, all Windows 7 computers, all Windows Server 2008, all Windows Server 2012, all Windows Server 2016, all Linux on IA-32, all Linux on AMD64, all Linux on ARM

Big-endian platforms (who don't need byte-swapping for network byte order):
the other less-than-small-fraction-of-1% of all other computers on the planet.  No hyperbole:  far far less than 1% of extant computers throughout planet Earth.

Good to know that (for ≥34 years!) Ada has been standardized for the less-than-small-fraction-of-1% of computers on the planet nowadays.  This isn't regarding the old arcane convert-COBOL-to-Ada featureset of Ada either.  This is regarding device drivers interacting with hardware ICs, which is supposedly one of Ada's A#1 key must-do marketspaces.

And the endian feature of AI12-0218 is not being embraced by the ARG.  Wow!  It is not viewed by the ARG as a ≥34-year-old embarrassment that might have actually caused unpopularity of Ada over the decades in its potential key advocates:  realtime software engineers writing device drivers in Ada's supposed key marketspace of reading & writing IC registers, meeting realtime deadlines before packet-arrival over-run (or whatever mission the IC is accomplishing in realtime).

The Challenge:
Without the proposed solution in AI12-0218, I challenge anyone to write an Ada representation clause that is •portable• to both little-endian and big-endian processors for either of the following IETF packet formats that must always be in big-endian network byte order:
https://en.wikipedia.org/wiki/IPv4#Packet_structure
https://en.wikipedia.org/wiki/IPv6_packet

Hint #1:  in C or C++, different definitions of preprocessor macros (controlled by #if conditional compilation directives)) would typically be utilized for portably cloaking lack-of-byte-swap-no-op on big-endian processors and byte-swapping on little-endian processors, but Ada lacks macros, so the ••representation clause•• in AI12-0218 (on only GNAT for now) is the only game in Adatown, it would seem.  And other than on GNAT in the past few years, the representation clause as standardized cannot accomplish the goal portably.


^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2018-05-30 19:38 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-10 17:45 AI12-0218: What is the portable representation clause for processing IETF packets on little-endian machines? Dan'l Miller
2018-05-10 19:24 ` Dan'l Miller
2018-05-10 20:32   ` Paul Rubin
2018-05-10 22:24     ` Dan'l Miller
2018-05-10 22:44       ` Niklas Holsti
2018-05-10 23:14         ` Paul Rubin
2018-05-11  2:38         ` Dan'l Miller
2018-05-11  7:55           ` Simon Wright
2018-05-11 12:11             ` Lucretia
2018-05-11 13:49               ` Simon Wright
2018-05-11 16:11                 ` Jeffrey R. Carter
2018-05-11 16:48                   ` Simon Wright
2018-05-11 19:08                     ` Jeffrey R. Carter
2018-05-11 21:39                       ` Simon Wright
2018-05-11 21:56                         ` Jeffrey R. Carter
2018-05-12  7:08                           ` Simon Wright
2018-05-12  7:53                             ` Jeffrey R. Carter
2018-05-14 22:43                             ` Randy Brukardt
2018-05-11 13:46             ` Simon Wright
2018-05-11 22:12           ` Randy Brukardt
2018-05-12 10:33             ` Björn Lundin
2018-05-12 13:08               ` Simon Wright
2018-05-12 14:21                 ` Björn Lundin
2018-05-10 23:07       ` Paul Rubin
2018-05-11  0:14         ` Dan'l Miller
2018-05-11  0:30           ` Paul Rubin
2018-05-11  0:50             ` Dan'l Miller
2018-05-11  1:34               ` Paul Rubin
2018-05-11  2:11                 ` Dan'l Miller
2018-05-11 22:32                   ` Randy Brukardt
2018-05-11  8:02         ` Simon Wright
2018-05-11 22:14         ` Randy Brukardt
2018-05-10 19:28 ` Simon Wright
2018-05-10 22:40   ` Randy Brukardt
2018-05-10 22:50     ` Dan'l Miller
2018-05-11 22:00       ` Randy Brukardt
2018-05-12  1:15         ` Paul Rubin
2018-05-14 22:54           ` Randy Brukardt
2018-05-15  0:43             ` Paul Rubin
2018-05-15 21:39               ` Randy Brukardt
2018-05-15  0:44             ` Dennis Lee Bieber
2018-05-11  8:09     ` Simon Wright
2018-05-10 19:34 ` Dmitry A. Kazakov
2018-05-10 20:06   ` Dan'l Miller
2018-05-10 22:44     ` Paul Rubin
2018-05-10 22:50     ` Randy Brukardt
2018-05-11  9:40       ` Niklas Holsti
2018-05-11 11:40         ` Dan'l Miller
2018-05-11 20:16           ` Niklas Holsti
2018-05-11  9:40     ` Dmitry A. Kazakov
2018-05-11 14:21 ` AdaMagica
2018-05-26 16:15 ` Dan'l Miller
2018-05-26 19:02   ` AdaMagica
2018-05-26 21:01     ` Dan'l Miller
2018-05-27 14:58       ` AdaMagica
2018-05-27 18:03         ` Simon Wright
2018-05-29 22:17           ` Randy Brukardt
2018-05-30  6:39             ` Simon Wright
2018-05-30  7:25               ` Dmitry A. Kazakov
2018-05-30 15:01                 ` Simon Wright
2018-05-30 15:59                   ` Dan'l Miller
2018-05-30 19:38               ` Randy Brukardt
2018-05-27 18:04         ` Dan'l Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox