Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Clever Code
  4. Protocol Design Bug

Protocol Design Bug

Scheduled Pinned Locked Moved Clever Code
helpdesigndebuggingtoolsquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PICguy
    wrote on last edited by
    #1

    I designed a LAN protocol for low bandwidth devices. Its first (and alas its only) use was for temperature monitoring in already well regulated refrigerators. My protocol used RS-232 at 38.4K baud with the transmit and receive lines tied together. All devices saw everything anyone put on the LAN. It should be clear from this that ‘twaz important for only one device to be transmitting at any given time. The LAN controller polled each device in turn and waited a reasonable amount of time for a response. Byte parity errors, message parity errors and timeouts were considered errors. The remote “pods” handled errors by waiting for 3 mSec of quiet on the line and restarted their normal wait for message. My controller code guaranteed an occasional 6 mSec of quiet. My bug: after saying all the things that were errors I included, “and if you don’t understand the message you receive then that is also an error.” I had the responsibility of sending arbitrary messages from my host to the temperature measuring pods. My host sent a message a pod did not understand and the pod appeared to die. Later, in an attempt to find recently connected pods I sent the “is anybody home” message to the apparently dead pod. The pod responded and (overt bug here) I sent its reply to my host. The host guy phoned me and basically said WTF is this? It took me a week with crap debug tools to find the thing. I have never designed another protocol. But if I do I will never forget to include a “I don’t understand this otherwise well formed message” response.

    R E 2 Replies Last reply
    0
    • P PICguy

      I designed a LAN protocol for low bandwidth devices. Its first (and alas its only) use was for temperature monitoring in already well regulated refrigerators. My protocol used RS-232 at 38.4K baud with the transmit and receive lines tied together. All devices saw everything anyone put on the LAN. It should be clear from this that ‘twaz important for only one device to be transmitting at any given time. The LAN controller polled each device in turn and waited a reasonable amount of time for a response. Byte parity errors, message parity errors and timeouts were considered errors. The remote “pods” handled errors by waiting for 3 mSec of quiet on the line and restarted their normal wait for message. My controller code guaranteed an occasional 6 mSec of quiet. My bug: after saying all the things that were errors I included, “and if you don’t understand the message you receive then that is also an error.” I had the responsibility of sending arbitrary messages from my host to the temperature measuring pods. My host sent a message a pod did not understand and the pod appeared to die. Later, in an attempt to find recently connected pods I sent the “is anybody home” message to the apparently dead pod. The pod responded and (overt bug here) I sent its reply to my host. The host guy phoned me and basically said WTF is this? It took me a week with crap debug tools to find the thing. I have never designed another protocol. But if I do I will never forget to include a “I don’t understand this otherwise well formed message” response.

      R Offline
      R Offline
      Roger Wright
      wrote on last edited by
      #2

      Why not borrow from Microsoft and use: ASP Error 500: Internal Server Error It's worked for them for years!:-D

      "...a photo album is like Life, but flat and stuck to pages." - Shog9

      1 Reply Last reply
      0
      • P PICguy

        I designed a LAN protocol for low bandwidth devices. Its first (and alas its only) use was for temperature monitoring in already well regulated refrigerators. My protocol used RS-232 at 38.4K baud with the transmit and receive lines tied together. All devices saw everything anyone put on the LAN. It should be clear from this that ‘twaz important for only one device to be transmitting at any given time. The LAN controller polled each device in turn and waited a reasonable amount of time for a response. Byte parity errors, message parity errors and timeouts were considered errors. The remote “pods” handled errors by waiting for 3 mSec of quiet on the line and restarted their normal wait for message. My controller code guaranteed an occasional 6 mSec of quiet. My bug: after saying all the things that were errors I included, “and if you don’t understand the message you receive then that is also an error.” I had the responsibility of sending arbitrary messages from my host to the temperature measuring pods. My host sent a message a pod did not understand and the pod appeared to die. Later, in an attempt to find recently connected pods I sent the “is anybody home” message to the apparently dead pod. The pod responded and (overt bug here) I sent its reply to my host. The host guy phoned me and basically said WTF is this? It took me a week with crap debug tools to find the thing. I have never designed another protocol. But if I do I will never forget to include a “I don’t understand this otherwise well formed message” response.

        E Offline
        E Offline
        Ed Poore
        wrote on last edited by
        #3

        You should see the protocol I've got to work with :mad:, makes yours sound very nice to work with.


        I have no idea what I just said but my intentions were sincere. Poore Design

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups