views:

111

answers:

2

I am not very clear about the idea of wire-level protocols. I heard BitTorrent uses it and read that a wirelevel protocol can be considered an opposite of API. I read RMI calls can be considered wirelevel protocols but am still a little confused. Can someone explain this in a better way?

+3  A: 

I wouldn't say that something uses a wire-level protocol or doesn't - I'd talk about which wire-level protocol it uses.

Basically, if something's communicating with a remote machine (even conceptually) then there's some data going across the network connection (the wire). The description of that data is the "wire-level protocol". Even within that, you would often stop short of describing individual network packets - so the wire protocol for a TCP-based protocol would usually be defined in terms of opening a connection, the data streams between the two computers, and probably details of when each side would be expected to close the connection.

Jon Skeet
Thank You. So does everything eventually end up using some or the other wire-level protocol?
Legend
There's more to it than that though - "wire level protocol" is a specific term which implies that there is a method-invocation-like interface in the protocol, e.g. SOAP, RMI, etc., or even SQL. I think of it a bit more like an API specified in terms of RPC than a particular language.
Eric Warmenhoven
Trying to tie this answer with some of the text in the question. Once you happily handle literal wire level protocols (as above) you can "consider" higher level concepts as wire level protocols. Typically, you do not need to worry about which wire level protocol is in use from your source code. It is either setup correctly and works, or it is not. I think "RMI calls can be considered wire level protocols" is basically saying that you can make the call without worrying about the technology between your call and the receiving side as if you were using a wire level protocol like TCP/IP. Jacob
TheJacobTaylor
@Eric: I don't see an implication of a method-invocation-like interface in the protocol. You could easily describe the wire level protocol of ping, NTP etc. Now I suppose you *could* think of those as being RMI-like (ping = "return true", NTP = "return the current time") but at that stage you're left wondering what network traffic *isn't* RMI-like. I see no reason to restrict the term "wire level protocol" to RMI.
Jon Skeet
@Jon: Fair enough, even at the TCP level you *could* think of e.g. a SYN packet being an invocation to connect, with the logical "return value" being either an ACK (success) or a RST (failure).... But you *wouldn't* think of it this way, because it's not natural. Whereas request/response protocols are much more naturally thought of as method invocation. It's a subtle difference to be sure, but an interesting one at least.
Eric Warmenhoven
Just as a final note, I read this sentence: "The bittorrent wire protocol is very simple. It is just plain HTTP requests and responses sent using something called "bencoding". The bencoding part is the wire-protocol here?
Legend
@Legend: Yes, that sounds like it's part of the wire protocol.
Jon Skeet
Great... Thanks a lot for the clarification.
Legend
A: 

I googled and found the following:

Examples:

  • HTTP
  • CORBA
  • DCOM
  • SOAP

Did you try this yourself? If so, what don't you understand?

hobodave
Sure. I did google and came across those links myself. Just that from what I learnt HTTP is an Application Layer protocol. When can I call it a wirelevel protocol is something that is confusing me...
Legend