1

I'm trying to develop a serial to ethernet bridge (half-duplex/rs485) in python.

The maxium allowed size of ethernet frames is 1536 bytes, but the maximum size of raw frames I can send from python is 1500 bytes. I don't know how to solve that.

Here is a part of my code which is sending the received frames to ethernet.

def ethernet_send(self):
"""
ethernet send thread
sends received data over ethernet
"""
# Init the Ethernet Socket
send_socket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW)
send_socket.bind((self.config["interface"], 0))

while True:
    # get next frame
    ethernet_frame = self.send_ethernet.get()

    # un escape data
    ethernet_frame = self.un_escape(ethernet_frame)

    # send data
    send_socket.send(ethernet_frame)
HyP3r
  • 11
  • 2
  • 1500 octets is the max payload of an ethernet frame. See here for a solution to your problem: http://stackoverflow.com/questions/6329583/how-to-reliably-generate-ethernet-frame-errors-in-software – Pynchia May 31 '15 at 20:09
  • look at jumbo frames, if that works? http://en.wikipedia.org/wiki/Jumbo_frame – VenkatC May 31 '15 at 22:39

0 Answers0