Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8625165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:42:54+00:00 2026-06-12T07:42:54+00:00

I’ve almost got it — but I’m missing key points….. I’m trying to figure

  • 0

I’ve almost got it — but I’m missing key points…..

I’m trying to figure out how one might built “layered” protocol stacks in Twisted. I can understand how one attached a single protocol and handles events with Defers, but with if I want the traditional OSI layers model? Assume I have a line-oriented protocol at the bottom on a TCP connector, and I want multiple line-oriented protocols stacked on top until I get to application space.

(Think of me wanted to implement the TCP/IP stack itself in twisted)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:42:55+00:00Added an answer on June 12, 2026 at 7:42 am

    The OSI layering model is mostly irrelevant to Twisted (and, I would posit, mostly irrelevant to software in general). Looking at each layer at a time:

    1. physical: obviously, Twisted is not an ethernet cable or a physical switch, so it can’t do this.
    2. data link: in order for Twisted to run over a network interface, your operating system needs to be connected to a physical network. data-link protocols typically need to be implemented in hard real-time equipment, often in hardware, so Twisted isn’t suitable for that.
    3. network: this layer, if it’s distinct from the “transport” layer, then it’s stuff like BGP and routers and whatnot which is happening distinct from your application.
    4. transport: At this layer, we have two interfaces, IProtocol and ITransport. The transport delivers bytes from the transport to an IProtocol via dataReceived, and the application delivers bytes to the transport via ITransport.write(). (This relationship is then inverted on the other end of the wire.)
    5. session: (this is implicitly part of the transport)
    6. presentation: this is like, CSS stylesheets or something
    7. application: obviously Twisted doesn’t do this part, you do it yourself.

    In-protocol layering, however, is somewhat more ad-hoc. The usual idiom right now is to simply subclass Protocol and then delegate from dataReceived to a new method, specific to your layering idiom, such as lineReceived, then have the next layer up subclass that.

    If you actually want a TCP implementation that uses Twisted, look here.

    If you want to see a proposal for interfaces that will improve layering within Twisted itself, see here instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.