Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!iconsys!caeco!i-core!geo-works!bryan From: bryan@geo-works.UUCP (Bryan Ford) Newsgroups: comp.sys.amiga Subject: Re: Software-only network protocol standards Message-ID: <1789.AA1789@geo-works> Date: 19 Jul 89 10:17:54 GMT References: <1089@sas.UUCP> <1719.AA1719@geo-works> <18559@usc.edu> Followup-To: comp.sys.amiga Lines: 58 In article <18559@usc.edu>, papa@pollux.usc.edu (Marco Papa) writes: >In article <1719.AA1719@geo-works> bryan@geo-works.UUCP (Bryan Ford) writes: >>DNET is written completely in C, and doesn't have enough OSI layering built >>into the code to make it easy to convert part to assembly language. When >>you're running at over 200KBPS, something in C just can't cut it. > >Oh, yea? What do you think is the language in which UNIX device drivers (serial >or network, take your pick), TCP/IP, sockets, etc ... have been written in? >Hint: the name of the language is one-letter long :-) And I can tell you that >that code supports data transfers > 200KBPS. Don't blame the language. You got >the wrong culprit. Maybe you're right, and I have overestimated the difference in speed of C and assembly language. In any case, let's not get into a 'C vs Assembly' war. However, consider this: This network has to run on a "lowest-level" 8 MHz Amiga (or is that 7.xx?). This means I must program for 125 nanoseconds per clock cycle, and no 68000 instruction takes less than two cycles (maybe more, I can't remember). I'm assuming that most Unix boxes run at much higher speeds, and since they inherently *require* at least a 68020 (if memory protection is supported), many of the instructions will also execute in less clock cycles (the 68020 often uses less clock cycles per instruction). At 200,000 baud, you have 5 milliseconds per bit and 50 milliseconds per byte (at 8N1). That means there are approximately 400 clock cycles per byte. This may seem like a lot, but remember that, in any single host, there at least *four* processes going at this speed: one sending and one receiving for each of the two required ports. And if there are more than two ports, the overhead is even greater. Since this is a multitasking machine, I don't want to bog down the system too much because of network handling. Only the raw transfer of raw data is handled in hardware in this case, while (for example) most Ethernet cards often handle things like error checking and resending bad packets. In addition, with an Ethernet network, packets go straight to the destination host without needing to be processed and rerouted by other hosts. In a mesh network, many hosts will have lots of data going through them, so there will be more traffic through each host. What I'll probably do is implement the network and data-link layers in assembly language, and do the rest in C. This way, only the end source and destination hosts of packets use C, while packets which just go 'through' a host never get to the C part (the Network layer rerouts them first.) Now, one question: How many overhead cycles do the Amiga's interrupt routines use (on a plain 68000)? I know it's not much, but I'd like to know exactly *how* much. How about for software interrupts? Thanks! Bryan -- _______________________________________ _/ Bryan Ford - bryan@geo-works.uucp \_ _/ ..!utah-cs!caeco!i-core!geo-works!bryan \_ / ..!uunet!iconsys!caeco!i-core!geo-works!bryan \