diff --git a/VERSION b/VERSION
index 9084fa2..26aaba0 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.1.0
+1.2.0
diff --git a/layers.go b/layers.go
index aa49e8c..4a527bf 100644
--- a/layers.go
+++ b/layers.go
@@ -50,7 +50,9 @@
 	LayerTypeSetTableRequest              gopacket.LayerType
 
 	// Extended Message Types
-	LayerTypeGetRequestExtended gopacket.LayerType
+	LayerTypeGetRequestExtended                 gopacket.LayerType
+	LayerTypeDownloadSectionRequestExtended     gopacket.LayerType
+	LayerTypeDownloadSectionLastRequestExtended gopacket.LayerType
 )
 var (
 	// Baseline Message Types
@@ -79,7 +81,8 @@
 	LayerTypeSetTableResponse              gopacket.LayerType
 
 	// Extended Message Types
-	LayerTypeGetResponseExtended gopacket.LayerType
+	LayerTypeGetResponseExtended             gopacket.LayerType
+	LayerTypeDownloadSectionResponseExtended gopacket.LayerType
 )
 
 func mkReqLayer(mt me.MsgType, mts string, decode gopacket.DecodeFunc) gopacket.LayerType {
@@ -151,6 +154,9 @@
 
 	LayerTypeGetRequestExtended = mkReqLayer(me.Get|me.ExtendedOffset, "GetRequest-Ext", gopacket.DecodeFunc(decodeGetRequestExtended))
 	LayerTypeGetResponseExtended = mkRespLayer(me.Get|me.ExtendedOffset, "GetResponse-Ext", gopacket.DecodeFunc(decodeGetResponseExtended))
+	LayerTypeDownloadSectionRequestExtended = mkLayer(me.DownloadSection|me.ExtendedOffset, "DownloadSectionRequest-Ext", gopacket.DecodeFunc(decodeDownloadSectionRequestExtended))
+	LayerTypeDownloadSectionLastRequestExtended = mkReqLayer(me.DownloadSection|me.ExtendedOffset, "DownloadLastSectionRequest-Ext", gopacket.DecodeFunc(decodeDownloadSectionRequestExtended))
+	LayerTypeDownloadSectionResponseExtended = mkRespLayer(me.DownloadSection|me.ExtendedOffset, "DownloadSectionResponse-Ext", gopacket.DecodeFunc(decodeDownloadSectionResponseExtended))
 
 	// Map message_type and action to layer
 	nextLayerMapping = make(map[MessageType]gopacket.LayerType)
@@ -205,6 +211,11 @@
 	// Extended message support
 	nextLayerMapping[GetRequestType+ExtendedTypeDecodeOffset] = LayerTypeGetRequestExtended
 	nextLayerMapping[GetResponseType+ExtendedTypeDecodeOffset] = LayerTypeGetResponseExtended
+
+	// For Download section, AR=0 if not response expected, AR=1 if response expected (last section of a window)
+	nextLayerMapping[DownloadSectionRequestType+ExtendedTypeDecodeOffset] = LayerTypeDownloadSectionRequestExtended
+	nextLayerMapping[DownloadSectionRequestWithResponseType+ExtendedTypeDecodeOffset] = LayerTypeDownloadSectionLastRequestExtended
+	nextLayerMapping[DownloadSectionResponseType+ExtendedTypeDecodeOffset] = LayerTypeDownloadSectionResponseExtended
 }
 
 func MsgTypeToNextLayer(mt MessageType, isExtended bool) (gopacket.LayerType, error) {
diff --git a/meframe.go b/meframe.go
index c13554c..472db31 100644
--- a/meframe.go
+++ b/meframe.go
@@ -283,17 +283,21 @@
 // Software related frames have a wide variety of settable values. Placing them
 // in a separate struct is mainly to keep the base options simple
 type SoftwareOptions struct {
-	WindowSize   uint8 // Window size - 1
-	ImageSize    uint32
-	CircuitPacks []uint16 // slot (upper 8 bits) and instance (lower 8 bits)
-	Results      []DownloadResults
+	WindowSize    uint8 // Window size - 1
+	SectionNumber uint8 // [0..Window size - 1]
+	ImageSize     uint32
+	CircuitPacks  []uint16 // slot (upper 8 bits) and instance (lower 8 bits)
+	Results       []DownloadResults
+	Data          []byte
 }
 
 var defaultSoftwareOptions = SoftwareOptions{
-	WindowSize:   0,
-	ImageSize:    0,
-	CircuitPacks: nil,
-	Results:      nil,
+	WindowSize:    0,
+	SectionNumber: 0,
+	ImageSize:     0,
+	CircuitPacks:  nil,
+	Results:       nil,
+	Data:          nil,
 }
 
 // EncodeFrame will encode the Managed Entity specific protocol struct and an
@@ -364,9 +368,9 @@
 	}
 	// OMCI Header          - 4 octets
 	// Class ID/Instance ID - 4 octets
-	// Length field			- 4 octets
+	// Length field			- 2 octets
 	// MIC                  - 4 octets
-	return MaxExtendedLength - 16
+	return MaxExtendedLength - 14
 }
 
 func calculateAttributeMask(m *me.ManagedEntity, requestedMask uint16) (uint16, error) {
@@ -1040,12 +1044,8 @@
 }
 
 func DownloadSectionRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
-	if opt.frameFormat == ExtendedIdent {
-		return nil, errors.New("Extended message set for this message type is not supported")
-	}
-	mask, err := checkAttributeMask(m, opt.attributeMask)
-	if err != nil {
-		return nil, err
+	if opt.software.Data == nil {
+		return nil, me.NewNonStatusError("Software image data missing")
 	}
 	// Common for all MEs
 	meLayer := &DownloadSectionRequest{
@@ -1054,24 +1054,13 @@
 			EntityInstance: m.GetEntityID(),
 			Extended:       opt.frameFormat == ExtendedIdent,
 		},
+		SectionNumber: opt.software.SectionNumber,
+		SectionData:   opt.software.Data,
 	}
-	// Get payload space available
-	maxPayload := maxPacketAvailable(m, opt)
-
-	// TODO: Lots of work to do
-
-	fmt.Println(mask, maxPayload)
-	return meLayer, errors.New("todo: Not implemented")
+	return meLayer, nil
 }
 
 func DownloadSectionResponseFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
-	if opt.frameFormat == ExtendedIdent {
-		return nil, errors.New("Extended message set for this message type is not supported")
-	}
-	mask, err := checkAttributeMask(m, opt.attributeMask)
-	if err != nil {
-		return nil, err
-	}
 	// Common for all MEs
 	meLayer := &DownloadSectionResponse{
 		MeBasePacket: MeBasePacket{
@@ -1079,14 +1068,10 @@
 			EntityInstance: m.GetEntityID(),
 			Extended:       opt.frameFormat == ExtendedIdent,
 		},
+		Result:        opt.result,
+		SectionNumber: opt.software.SectionNumber,
 	}
-	// Get payload space available
-	maxPayload := maxPacketAvailable(m, opt)
-
-	// TODO: Lots of work to do
-
-	fmt.Println(mask, maxPayload)
-	return meLayer, errors.New("todo: Not implemented")
+	return meLayer, nil
 }
 
 func EndSoftwareDownloadRequestFrame(m *me.ManagedEntity, opt options) (gopacket.SerializableLayer, error) {
diff --git a/meframe_test.go b/meframe_test.go
index cf42492..fd9d339 100644
--- a/meframe_test.go
+++ b/meframe_test.go
@@ -52,6 +52,8 @@
 	messageTypeTestFuncs[MibResetResponseType] = testMibResetResponseTypeMeFrame
 	messageTypeTestFuncs[TestRequestType] = testTestRequestTypeMeFrame
 	messageTypeTestFuncs[TestResponseType] = testTestResponseTypeMeFrame
+
+	// For Download section, AR=0 if not response expected, AR=1 if response expected (last section of a window)4
 	messageTypeTestFuncs[StartSoftwareDownloadRequestType] = testStartSoftwareDownloadRequestTypeMeFrame
 	messageTypeTestFuncs[StartSoftwareDownloadResponseType] = testStartSoftwareDownloadResponseTypeMeFrame
 	messageTypeTestFuncs[DownloadSectionRequestType] = testDownloadSectionRequestTypeMeFrame
@@ -79,6 +81,11 @@
 	// Supported Extended message set types here
 	messageTypeTestFuncs[GetRequestType+ExtendedTypeDecodeOffset] = testGetRequestTypeMeFrame
 	messageTypeTestFuncs[GetResponseType+ExtendedTypeDecodeOffset] = testGetResponseTypeMeFrame
+
+	// For Download section, AR=0 if not response expected, AR=1 if response expected (last section of a window)
+	messageTypeTestFuncs[DownloadSectionRequestType+ExtendedTypeDecodeOffset] = testDownloadSectionRequestTypeMeFrame
+	// TODO: messageTypeTestFuncs[DownloadSectionRequestWithResponseType+ExtendedTypeDecodeOffset] = testDownloadSectionLastRequestTypeMeFrame
+	messageTypeTestFuncs[DownloadSectionResponseType+ExtendedTypeDecodeOffset] = testDownloadSectionResponseTypeMeFrame
 }
 
 func getMEsThatSupportAMessageType(messageType MessageType) []*me.ManagedEntity {
@@ -1460,11 +1467,117 @@
 }
 
 func testDownloadSectionRequestTypeMeFrame(t *testing.T, managedEntity *me.ManagedEntity, messageSet DeviceIdent) {
-	// TODO: Implement
+	// TODO: In future, also support slot/multiple download formats
+	instance := uint16(0)
+	image := uint16(rand.Intn(1)) // Image 0 or 1 for this test
+	params := me.ParamData{
+		EntityID: (instance << 8) + image,
+	}
+	// Create the managed instance
+	meInstance, err := me.NewManagedEntity(managedEntity.GetManagedEntityDefinition(), params)
+	assert.NotNil(t, err)
+	assert.Equal(t, err.StatusCode(), me.Success)
+
+	tid := uint16(rand.Int31n(0xFFFE) + 1) // [1, 0xFFFF]
+	var data []byte
+
+	if messageSet == ExtendedIdent {
+		data = make([]byte, MaxDownloadSectionExtendedLength)
+	} else {
+		data = make([]byte, MaxDownloadSectionLength)
+	}
+	for index, _ := range data {
+		data[index] = byte(index & 0xFF)
+	}
+	options := SoftwareOptions{
+		SectionNumber: uint8(rand.Int31n(255)), // [0, 255]
+		Data:          data,
+	}
+	frame, omciErr := GenFrame(meInstance, DownloadSectionRequestType,
+		TransactionID(tid), Software(options), FrameFormat(messageSet))
+	assert.NotNil(t, frame)
+	assert.NotZero(t, len(frame))
+	assert.Nil(t, omciErr)
+
+	///////////////////////////////////////////////////////////////////
+	// Now decode and compare
+	packet := gopacket.NewPacket(frame, LayerTypeOMCI, gopacket.NoCopy)
+	assert.NotNil(t, packet)
+
+	omciLayer := packet.Layer(LayerTypeOMCI)
+	assert.NotNil(t, omciLayer)
+
+	omciObj, omciOk := omciLayer.(*OMCI)
+	assert.NotNil(t, omciObj)
+	assert.True(t, omciOk)
+	assert.Equal(t, tid, omciObj.TransactionID)
+	assert.Equal(t, DownloadSectionRequestType, omciObj.MessageType)
+	assert.Equal(t, messageSet, omciObj.DeviceIdentifier)
+
+	msgLayer := packet.Layer(LayerTypeDownloadSectionRequest)
+	assert.NotNil(t, msgLayer)
+
+	msgObj, msgOk := msgLayer.(*DownloadSectionRequest)
+	assert.NotNil(t, msgObj)
+	assert.True(t, msgOk)
+
+	assert.Equal(t, meInstance.GetClassID(), msgObj.EntityClass)
+	assert.Equal(t, meInstance.GetEntityID(), msgObj.EntityInstance)
+	assert.Equal(t, options.SectionNumber, msgObj.SectionNumber)
+	assert.NotNil(t, msgObj.SectionData)
+	assert.Equal(t, options.Data, msgObj.SectionData)
 }
 
 func testDownloadSectionResponseTypeMeFrame(t *testing.T, managedEntity *me.ManagedEntity, messageSet DeviceIdent) {
-	// TODO: Implement
+	instance := uint16(0)
+	image := uint16(rand.Intn(1)) // Image 0 or 1 for this test
+	params := me.ParamData{
+		EntityID: (instance << 8) + image,
+	}
+	// Create the managed instance
+	meInstance, err := me.NewManagedEntity(managedEntity.GetManagedEntityDefinition(), params)
+	assert.NotNil(t, err)
+	assert.Equal(t, err.StatusCode(), me.Success)
+
+	tid := uint16(rand.Int31n(0xFFFE) + 1) // [1, 0xFFFF]
+	result := me.Results(rand.Int31n(7))   // [0, 6] Not all types will be tested
+	swOptions := SoftwareOptions{
+		SectionNumber: uint8(rand.Int31n(255)), // [0, 255]
+	}
+	var frame []byte
+	frame, omciErr := GenFrame(meInstance, DownloadSectionResponseType, TransactionID(tid),
+		Result(result), FrameFormat(messageSet), Software(swOptions))
+
+	assert.NotNil(t, frame)
+	assert.NotZero(t, len(frame))
+	assert.Nil(t, omciErr)
+
+	///////////////////////////////////////////////////////////////////
+	// Now decode and compare
+	packet := gopacket.NewPacket(frame, LayerTypeOMCI, gopacket.NoCopy)
+	assert.NotNil(t, packet)
+
+	omciLayer := packet.Layer(LayerTypeOMCI)
+	assert.NotNil(t, omciLayer)
+
+	omciObj, omciOk := omciLayer.(*OMCI)
+	assert.NotNil(t, omciObj)
+	assert.True(t, omciOk)
+	assert.Equal(t, tid, omciObj.TransactionID)
+	assert.Equal(t, DownloadSectionResponseType, omciObj.MessageType)
+	assert.Equal(t, messageSet, omciObj.DeviceIdentifier)
+
+	msgLayer := packet.Layer(LayerTypeDownloadSectionResponse)
+	assert.NotNil(t, msgLayer)
+
+	msgObj, msgOk := msgLayer.(*DownloadSectionResponse)
+	assert.NotNil(t, msgObj)
+	assert.True(t, msgOk)
+
+	assert.Equal(t, meInstance.GetClassID(), msgObj.EntityClass)
+	assert.Equal(t, meInstance.GetEntityID(), msgObj.EntityInstance)
+	assert.Equal(t, result, msgObj.Result)
+	assert.Equal(t, swOptions.SectionNumber, msgObj.SectionNumber)
 }
 
 func testEndSoftwareDownloadRequestTypeMeFrame(t *testing.T, managedEntity *me.ManagedEntity, messageSet DeviceIdent) {
diff --git a/messagetypes.go b/messagetypes.go
index 456bef8..94fc257 100644
--- a/messagetypes.go
+++ b/messagetypes.go
@@ -2353,17 +2353,18 @@
 	return nil
 }
 
-/////////////////////////////////////////////////////////////////////////////
-//
+// DownloadSectionRequest data is bound by the message set in use. For the
+// Baseline message set use MaxDownloadSectionLength and for the Extended message
+// set, MaxDownloadSectionExtendedLength is provided
 type DownloadSectionRequest struct {
 	MeBasePacket  // Note: EntityInstance for software download is two specific values
 	SectionNumber byte
-	SectionData   [31]byte // 0 padding if final transfer requires only a partial block
+	SectionData   []byte // 0 padding if final transfer requires only a partial block for baseline set
 }
 
 func (omci *DownloadSectionRequest) String() string {
-	return fmt.Sprintf("%v, Section #: %v",
-		omci.MeBasePacket.String(), omci.SectionNumber)
+	return fmt.Sprintf("%v, Section #: %v, Data Length: %v",
+		omci.MeBasePacket.String(), omci.SectionNumber, len(omci.SectionData))
 }
 
 // DecodeFromBytes decodes the given bytes of a Download Section Request into this layer
@@ -2386,8 +2387,28 @@
 	if omci.EntityClass != me.SoftwareImageClassID {
 		return me.NewProcessingError("invalid Entity Class for Download Section request")
 	}
-	omci.SectionNumber = data[4]
-	copy(omci.SectionData[0:], data[5:])
+	if omci.Extended {
+		if len(data) < 7 {
+			p.SetTruncated()
+			return errors.New("frame too small")
+		}
+		if len(data[7:]) > MaxDownloadSectionExtendedLength {
+			return errors.New(fmt.Sprintf("software image data too large. Received %v, Max: %v",
+				len(data[7:]), MaxDownloadSectionExtendedLength))
+		}
+		omci.SectionData = make([]byte, len(data[7:]))
+		omci.SectionNumber = data[6]
+		copy(omci.SectionData, data[7:])
+	} else {
+		if len(data[5:]) != MaxDownloadSectionLength {
+			p.SetTruncated()
+			return errors.New(fmt.Sprintf("software image size invalid. Received %v, Expected: %v",
+				len(data[5:]), MaxDownloadSectionLength))
+		}
+		omci.SectionData = make([]byte, MaxDownloadSectionLength)
+		omci.SectionNumber = data[4]
+		copy(omci.SectionData, data[5:])
+	}
 	return nil
 }
 
@@ -2397,6 +2418,13 @@
 	return decodingLayerDecoder(omci, data, p)
 }
 
+func decodeDownloadSectionRequestExtended(data []byte, p gopacket.PacketBuilder) error {
+	omci := &DownloadSectionRequest{}
+	omci.MsgLayerType = LayerTypeDownloadSectionRequest
+	omci.Extended = true
+	return decodingLayerDecoder(omci, data, p)
+}
+
 // SerializeTo provides serialization of an Download Section Request message
 func (omci *DownloadSectionRequest) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
 	// Basic (common) OMCI Header is 8 octets, 10
@@ -2417,12 +2445,40 @@
 	if omci.EntityClass != me.SoftwareImageClassID {
 		return me.NewProcessingError("invalid Entity Class for Download Section response")
 	}
-	bytes, err := b.AppendBytes(1 + len(omci.SectionData))
-	if err != nil {
-		return err
+	sectionLength := len(omci.SectionData)
+	if omci.Extended {
+		if sectionLength > MaxDownloadSectionExtendedLength {
+			msg := fmt.Sprintf("invalid Download Section data length, must be <= %v, received: %v",
+				MaxDownloadSectionExtendedLength, sectionLength)
+			return me.NewProcessingError(msg)
+		}
+		// Append section data
+		bytes, err := b.AppendBytes(3 + sectionLength)
+		if err != nil {
+			return err
+		}
+		binary.BigEndian.PutUint16(bytes, uint16(1+sectionLength))
+		bytes[2] = omci.SectionNumber
+		copy(bytes[3:], omci.SectionData)
+	} else {
+		if sectionLength > MaxDownloadSectionLength {
+			msg := fmt.Sprintf("invalid Download Section data length, must be <= %v, received: %v",
+				MaxDownloadSectionLength, sectionLength)
+			return me.NewProcessingError(msg)
+		}
+		// Append section data
+		bytes, err := b.AppendBytes(1 + MaxDownloadSectionLength)
+		if err != nil {
+			return err
+		}
+		bytes[0] = omci.SectionNumber
+		copy(bytes[1:], omci.SectionData)
+
+		// Zero extended if needed
+		if sectionLength < MaxDownloadSectionLength {
+			copy(omci.SectionData[sectionLength:], lotsOfZeros[:MaxDownloadSectionLength-sectionLength])
+		}
 	}
-	bytes[0] = omci.SectionNumber
-	copy(bytes[1:], omci.SectionData[0:])
 	return nil
 }
 
@@ -2459,13 +2515,22 @@
 	if omci.EntityClass != me.SoftwareImageClassID {
 		return me.NewProcessingError("invalid Entity Class for Download Section response")
 	}
-	omci.Result = me.Results(data[4])
+	if omci.Extended {
+		if len(data) < 8 {
+			p.SetTruncated()
+			return errors.New("frame too small")
+		}
+		omci.Result = me.Results(data[6])
+		omci.SectionNumber = data[7]
+	} else {
+		omci.Result = me.Results(data[4])
+		omci.SectionNumber = data[5]
+	}
 	if omci.Result > me.DeviceBusy {
 		msg := fmt.Sprintf("invalid results for Download Section response: %v, must be 0..6",
 			omci.Result)
 		return errors.New(msg)
 	}
-	omci.SectionNumber = data[5]
 	return nil
 }
 
@@ -2475,6 +2540,13 @@
 	return decodingLayerDecoder(omci, data, p)
 }
 
+func decodeDownloadSectionResponseExtended(data []byte, p gopacket.PacketBuilder) error {
+	omci := &DownloadSectionResponse{}
+	omci.MsgLayerType = LayerTypeDownloadSectionResponse
+	omci.Extended = true
+	return decodingLayerDecoder(omci, data, p)
+}
+
 // SerializeTo provides serialization of an Download Section Response message
 func (omci *DownloadSectionResponse) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error {
 	// Basic (common) OMCI Header is 8 octets, 10
@@ -2495,17 +2567,27 @@
 	if omci.EntityClass != me.SoftwareImageClassID {
 		return me.NewProcessingError("invalid Entity Class for Download Section response")
 	}
-	bytes, err := b.AppendBytes(2)
-	if err != nil {
-		return err
-	}
 	if omci.Result > me.DeviceBusy {
 		msg := fmt.Sprintf("invalid results for Download Section response: %v, must be 0..6",
 			omci.Result)
 		return errors.New(msg)
 	}
-	bytes[0] = byte(omci.Result)
-	bytes[1] = omci.SectionNumber
+	if omci.Extended {
+		bytes, err := b.AppendBytes(4)
+		if err != nil {
+			return err
+		}
+		binary.BigEndian.PutUint16(bytes, uint16(2))
+		bytes[2] = byte(omci.Result)
+		bytes[3] = omci.SectionNumber
+	} else {
+		bytes, err := b.AppendBytes(2)
+		if err != nil {
+			return err
+		}
+		bytes[0] = byte(omci.Result)
+		bytes[1] = omci.SectionNumber
+	}
 	return nil
 }
 
diff --git a/messagetypes_test.go b/messagetypes_test.go
index 9a9d2e7..23e020c 100644
--- a/messagetypes_test.go
+++ b/messagetypes_test.go
@@ -1654,12 +1654,12 @@
 	assert.True(t, ok2)
 	assert.NotNil(t, request)
 	assert.Equal(t, uint8(0xcc), request.SectionNumber)
-	assert.Equal(t, 31, len(request.SectionData))
+	assert.Equal(t, MaxDownloadSectionLength, len(request.SectionData))
 
 	sectionData, genErr := stringToPacket("01020304050607080910111213141516171819202122232425262728293031")
 	assert.Nil(t, genErr)
 	assert.NotNil(t, sectionData)
-	assert.Equal(t, 31, len(sectionData))
+	assert.Equal(t, MaxDownloadSectionLength, len(sectionData))
 	assert.Equal(t, sectionData, request.SectionData[:])
 
 	// Verify string output for message
@@ -1698,7 +1698,7 @@
 	sectionData, genErr := stringToPacket("01020304050607080910111213141516171819202122232425262728293031")
 	assert.Nil(t, genErr)
 	assert.NotNil(t, sectionData)
-	assert.Equal(t, 31, len(sectionData))
+	assert.Equal(t, MaxDownloadSectionLength, len(sectionData))
 	assert.Equal(t, sectionData, request.SectionData[:])
 
 	// Verify string output for message
@@ -1718,7 +1718,7 @@
 	sectionData, genErr := stringToPacket("01020304050607080910111213141516171819202122232425262728293031")
 	assert.Nil(t, genErr)
 	assert.NotNil(t, sectionData)
-	assert.Equal(t, 31, len(sectionData))
+	assert.Equal(t, MaxDownloadSectionLength, len(sectionData))
 
 	request := &DownloadSectionRequest{
 		MeBasePacket: MeBasePacket{
@@ -1726,9 +1726,44 @@
 			// Default Instance ID is 0
 		},
 		SectionNumber: 0xcc,
+		SectionData:   sectionData,
 	}
-	copy(request.SectionData[:], sectionData)
+	// Test serialization back to former string
+	var options gopacket.SerializeOptions
+	options.FixLengths = true
 
+	buffer := gopacket.NewSerializeBuffer()
+	err := gopacket.SerializeLayers(buffer, options, omciLayer, request)
+	assert.NoError(t, err)
+
+	outgoingPacket := buffer.Bytes()
+	reconstituted := packetToString(outgoingPacket)
+	assert.Equal(t, strings.ToLower(goodMessage), reconstituted)
+}
+
+func TestDownloadSectionRequestSerializeNoResponsePartialDataExpected(t *testing.T) {
+	// If a small buffer is provided, serialize will now zero extend the baseline format
+	goodMessage := "0123140a00070000cc0102030405060708091011121314151617181920212223242526272829000000000028"
+
+	omciLayer := &OMCI{
+		TransactionID: 0x0123,
+		MessageType:   DownloadSectionRequestType,
+		// DeviceIdentifier: omci.BaselineIdent,		// Optional, defaults to Baseline
+		// Length:           0x28,						// Optional, defaults to 40 octets
+	}
+	sectionData, genErr := stringToPacket("0102030405060708091011121314151617181920212223242526272829")
+	assert.Nil(t, genErr)
+	assert.NotNil(t, sectionData)
+	assert.Equal(t, MaxDownloadSectionLength-2, len(sectionData)) // Partial data buffer
+
+	request := &DownloadSectionRequest{
+		MeBasePacket: MeBasePacket{
+			EntityClass: me.SoftwareImageClassID,
+			// Default Instance ID is 0
+		},
+		SectionNumber: 0xcc,
+		SectionData:   sectionData,
+	}
 	// Test serialization back to former string
 	var options gopacket.SerializeOptions
 	options.FixLengths = true
@@ -1755,7 +1790,7 @@
 	sectionData, genErr := stringToPacket("01020304050607080910111213141516171819202122232425262728293031")
 	assert.Nil(t, genErr)
 	assert.NotNil(t, sectionData)
-	assert.Equal(t, 31, len(sectionData))
+	assert.Equal(t, MaxDownloadSectionLength, len(sectionData))
 
 	request := &DownloadSectionRequest{
 		MeBasePacket: MeBasePacket{
@@ -1763,9 +1798,8 @@
 			// Default Instance ID is 0
 		},
 		SectionNumber: 0xcc,
+		SectionData:   sectionData,
 	}
-	copy(request.SectionData[:], sectionData)
-
 	// Test serialization back to former string
 	var options gopacket.SerializeOptions
 	options.FixLengths = true
@@ -1792,7 +1826,7 @@
 	sectionData, genErr := stringToPacket("01020304050607080910111213141516171819202122232425262728293031")
 	assert.Nil(t, genErr)
 	assert.NotNil(t, sectionData)
-	assert.Equal(t, 31, len(sectionData))
+	assert.Equal(t, MaxDownloadSectionLength, len(sectionData))
 
 	request := &DownloadSectionRequest{
 		MeBasePacket: MeBasePacket{
@@ -1800,9 +1834,8 @@
 			EntityInstance: 0x0001, // Default is zero, here we want image 1
 		},
 		SectionNumber: 0xcc,
+		SectionData:   sectionData,
 	}
-	copy(request.SectionData[:], sectionData)
-
 	// Test serialization back to former string
 	var options gopacket.SerializeOptions
 	options.FixLengths = true
@@ -3064,6 +3097,32 @@
 	assert.NotZero(t, len(packetString))
 }
 
+func TestExtendedGetRequestDecodeTruncated(t *testing.T) {
+	goodMessage := "035e490b010100000002ff"
+	data, err := stringToPacket(goodMessage)
+	assert.NoError(t, err)
+
+	packet := gopacket.NewPacket(data, LayerTypeOMCI, gopacket.NoCopy)
+	assert.NotNil(t, packet)
+
+	failure := packet.ErrorLayer()
+	assert.NotNil(t, failure)
+
+	decodeFailure, ok := failure.(*gopacket.DecodeFailure)
+	assert.NotNil(t, decodeFailure)
+	assert.True(t, ok)
+	assert.NotNil(t, decodeFailure.String())
+	assert.True(t, len(decodeFailure.String()) > 0)
+
+	metadata := packet.Metadata()
+	assert.NotNil(t, metadata)
+	assert.True(t, metadata.Truncated)
+
+	// Verify string output for message
+	packetString := packet.String()
+	assert.NotZero(t, len(packetString))
+}
+
 func TestExtendedGetRequestSerialize(t *testing.T) {
 	goodMessage := "035e490b010100000002fffc"
 
@@ -3254,6 +3313,348 @@
 	assert.Equal(t, strings.ToLower(goodMessage), reconstituted)
 }
 
+//                    1                   2                   3                   4
+//  1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
+// 0008140a00070001		    - Download section, AR=0
+//                 cc       - Section 0xcc
+//                   01020304050607080910111213141516171819202122232425262728293031
+//                                                                                 00000028
+func TestExtendedDownloadSectionRequestDecodeNoResponseExpected(t *testing.T) {
+	goodMessage := "0008140b00070001"
+	payloadFragment := "01020304050607080910111213141516171819202122232425"
+	payloadTotal := payloadFragment + payloadFragment + payloadFragment + payloadFragment +
+		payloadFragment + payloadFragment + payloadFragment + payloadFragment
+	sectionNumber := 0x88
+	length := 1 + (8 * 25)
+	hdr := fmt.Sprintf("%04x%02x", length, sectionNumber)
+	goodMessage += hdr + payloadTotal
+	data, err := stringToPacket(goodMessage)
+	assert.NoError(t, err)
+
+	packet := gopacket.NewPacket(data, LayerTypeOMCI, gopacket.NoCopy)
+	assert.NotNil(t, packet)
+	assert.Nil(t, packet.ErrorLayer())
+
+	omciLayer := packet.Layer(LayerTypeOMCI)
+	assert.NotNil(t, omciLayer)
+
+	omciMsg, ok := omciLayer.(*OMCI)
+	assert.True(t, ok)
+	assert.Equal(t, uint16(0x0008), omciMsg.TransactionID)
+	assert.Equal(t, DownloadSectionRequestType, omciMsg.MessageType)
+	assert.False(t, omciMsg.ResponseExpected)
+	assert.Equal(t, ExtendedIdent, omciMsg.DeviceIdentifier)
+	assert.Equal(t, uint16(length), omciMsg.Length)
+
+	msgLayer := packet.Layer(LayerTypeDownloadSectionRequest)
+	assert.NotNil(t, msgLayer)
+
+	request, ok2 := msgLayer.(*DownloadSectionRequest)
+	assert.True(t, ok2)
+	assert.NotNil(t, request)
+	assert.Equal(t, uint8(sectionNumber), request.SectionNumber)
+	assert.Equal(t, length-1, len(request.SectionData))
+
+	data, err = stringToPacket(payloadTotal)
+	assert.NoError(t, err)
+	assert.Equal(t, data, request.SectionData[:])
+
+	// Verify string output for message
+	packetString := packet.String()
+	assert.NotZero(t, len(packetString))
+}
+
+func TestExtendedDownloadSectionRequestDecodeResponseExpected(t *testing.T) {
+	goodMessage := "0008540b00070001"
+	payloadFragment := "01020304050607080910111213141516171819202122232425"
+	payloadTotal := payloadFragment + payloadFragment + payloadFragment + payloadFragment +
+		payloadFragment + payloadFragment + payloadFragment + payloadFragment +
+		payloadFragment + payloadFragment + payloadFragment + payloadFragment +
+		payloadFragment + payloadFragment + payloadFragment + payloadFragment +
+		payloadFragment + payloadFragment + payloadFragment + payloadFragment
+	sectionNumber := 0x88
+	length := 1 + (20 * 25)
+	hdr := fmt.Sprintf("%04x%02x", length, sectionNumber)
+	goodMessage += hdr + payloadTotal
+	data, err := stringToPacket(goodMessage)
+	assert.NoError(t, err)
+
+	packet := gopacket.NewPacket(data, LayerTypeOMCI, gopacket.NoCopy)
+	assert.NotNil(t, packet)
+	assert.Nil(t, packet.ErrorLayer())
+
+	omciLayer := packet.Layer(LayerTypeOMCI)
+	assert.NotNil(t, omciLayer)
+
+	omciMsg, ok := omciLayer.(*OMCI)
+	assert.True(t, ok)
+	assert.Equal(t, uint16(0x0008), omciMsg.TransactionID)
+	assert.Equal(t, DownloadSectionRequestWithResponseType, omciMsg.MessageType)
+	assert.True(t, omciMsg.ResponseExpected)
+	assert.Equal(t, ExtendedIdent, omciMsg.DeviceIdentifier)
+	assert.Equal(t, uint16(length), omciMsg.Length)
+
+	msgLayer := packet.Layer(LayerTypeDownloadSectionRequest)
+	assert.NotNil(t, msgLayer)
+
+	request, ok2 := msgLayer.(*DownloadSectionRequest)
+	assert.True(t, ok2)
+	assert.NotNil(t, request)
+	assert.Equal(t, uint8(sectionNumber), request.SectionNumber)
+	assert.Equal(t, length-1, len(request.SectionData))
+
+	data, err = stringToPacket(payloadTotal)
+	assert.NoError(t, err)
+	assert.Equal(t, data, request.SectionData)
+
+	// Verify string output for message
+	packetString := packet.String()
+	assert.NotZero(t, len(packetString))
+}
+
+func TestExtendedDownloadSectionRequestDecodeTruncated(t *testing.T) {
+	goodMessage := "0008540b000700010000"
+	data, err := stringToPacket(goodMessage)
+	assert.NoError(t, err)
+
+	packet := gopacket.NewPacket(data, LayerTypeOMCI, gopacket.NoCopy)
+	assert.NotNil(t, packet)
+
+	failure := packet.ErrorLayer()
+	assert.NotNil(t, failure)
+
+	decodeFailure, ok := failure.(*gopacket.DecodeFailure)
+	assert.NotNil(t, decodeFailure)
+	assert.True(t, ok)
+	assert.NotNil(t, decodeFailure.String())
+	assert.True(t, len(decodeFailure.String()) > 0)
+
+	metadata := packet.Metadata()
+	assert.NotNil(t, metadata)
+	assert.True(t, metadata.Truncated)
+
+	// Verify string output for message
+	packetString := packet.String()
+	assert.NotZero(t, len(packetString))
+}
+
+func TestExtendedDownloadSectionRequestSerializeNoResponseExpected(t *testing.T) {
+	goodMessage := "0123140b00070001"
+	payloadFragment := "01020304050607080910111213141516171819202122232425"
+	payloadTotal := payloadFragment + payloadFragment + payloadFragment + payloadFragment +
+		payloadFragment + payloadFragment + payloadFragment + payloadFragment
+	sectionNumber := 0x84
+	length := 1 + (8 * 25)
+	hdr := fmt.Sprintf("%04x%02x", length, sectionNumber)
+	goodMessage += hdr + payloadTotal
+
+	omciLayer := &OMCI{
+		TransactionID:    0x0123,
+		MessageType:      DownloadSectionRequestType,
+		DeviceIdentifier: ExtendedIdent,
+	}
+	sectionData, genErr := stringToPacket(payloadTotal)
+	assert.Nil(t, genErr)
+	assert.NotNil(t, sectionData)
+	assert.Equal(t, len(payloadTotal)/2, len(sectionData))
+
+	request := &DownloadSectionRequest{
+		MeBasePacket: MeBasePacket{
+			EntityClass:    me.SoftwareImageClassID,
+			EntityInstance: uint16(1),
+			Extended:       true,
+		},
+		SectionNumber: byte(sectionNumber),
+		SectionData:   sectionData,
+	}
+	// Test serialization back to former string
+	var options gopacket.SerializeOptions
+	options.FixLengths = true
+
+	buffer := gopacket.NewSerializeBuffer()
+	err := gopacket.SerializeLayers(buffer, options, omciLayer, request)
+	assert.NoError(t, err)
+
+	outgoingPacket := buffer.Bytes()
+	reconstituted := packetToString(outgoingPacket)
+	assert.Equal(t, strings.ToLower(goodMessage), reconstituted)
+}
+
+func TestExtendedDownloadSectionRequestSerializeResponseExpectedMethod1(t *testing.T) {
+	goodMessage := "2468540b00070001"
+	payloadFragment := "01020304050607080910111213141516171819202122232425"
+	payloadTotal := payloadFragment + payloadFragment + payloadFragment + payloadFragment +
+		payloadFragment + payloadFragment + payloadFragment + payloadFragment
+	sectionNumber := 0x84
+	length := 1 + (8 * 25)
+	hdr := fmt.Sprintf("%04x%02x", length, sectionNumber)
+	goodMessage += hdr + payloadTotal
+
+	omciLayer := &OMCI{
+		TransactionID:    0x2468,
+		MessageType:      DownloadSectionRequestType, // or DownloadSectionRequestWithResponseType
+		ResponseExpected: true,
+		DeviceIdentifier: ExtendedIdent,
+	}
+	sectionData, genErr := stringToPacket(payloadTotal)
+	assert.Nil(t, genErr)
+	assert.NotNil(t, sectionData)
+	assert.Equal(t, len(payloadTotal)/2, len(sectionData))
+
+	request := &DownloadSectionRequest{
+		MeBasePacket: MeBasePacket{
+			EntityClass:    me.SoftwareImageClassID,
+			EntityInstance: uint16(1),
+			Extended:       true,
+		},
+		SectionNumber: byte(sectionNumber),
+		SectionData:   sectionData,
+	}
+	// Test serialization back to former string
+	var options gopacket.SerializeOptions
+	options.FixLengths = true
+
+	buffer := gopacket.NewSerializeBuffer()
+	err := gopacket.SerializeLayers(buffer, options, omciLayer, request)
+	assert.NoError(t, err)
+
+	outgoingPacket := buffer.Bytes()
+	reconstituted := packetToString(outgoingPacket)
+	assert.Equal(t, strings.ToLower(goodMessage), reconstituted)
+}
+
+func TestExtendedDownloadSectionRequestSerializeResponseExpectedMethod2(t *testing.T) {
+	goodMessage := "2468540b00070001"
+	payloadFragment := "01020304050607080910111213141516171819202122232425"
+	payloadTotal := payloadFragment + payloadFragment + payloadFragment + payloadFragment +
+		payloadFragment + payloadFragment + payloadFragment + payloadFragment
+	sectionNumber := 0x84
+	length := 1 + (8 * 25)
+	hdr := fmt.Sprintf("%04x%02x", length, sectionNumber)
+	goodMessage += hdr + payloadTotal
+
+	// In this case, just use the request type with AR response requested already encoded
+	omciLayer := &OMCI{
+		TransactionID:    0x2468,
+		MessageType:      DownloadSectionRequestWithResponseType,
+		ResponseExpected: true,
+		DeviceIdentifier: ExtendedIdent,
+	}
+	sectionData, genErr := stringToPacket(payloadTotal)
+	assert.Nil(t, genErr)
+	assert.NotNil(t, sectionData)
+	assert.Equal(t, len(payloadTotal)/2, len(sectionData))
+
+	request := &DownloadSectionRequest{
+		MeBasePacket: MeBasePacket{
+			EntityClass:    me.SoftwareImageClassID,
+			EntityInstance: 0x0001, // Default is zero, here we want image 1
+			Extended:       true,
+		},
+		SectionNumber: byte(sectionNumber),
+		SectionData:   sectionData,
+	}
+	// Test serialization back to former string
+	var options gopacket.SerializeOptions
+	options.FixLengths = true
+
+	buffer := gopacket.NewSerializeBuffer()
+	err := gopacket.SerializeLayers(buffer, options, omciLayer, request)
+	assert.NoError(t, err)
+
+	outgoingPacket := buffer.Bytes()
+	reconstituted := packetToString(outgoingPacket)
+	assert.Equal(t, strings.ToLower(goodMessage), reconstituted)
+}
+
+func TestExtendedDownloadSectionResponseDecode(t *testing.T) {
+	goodMessage := "0022340b000700010002061f"
+	data, err := stringToPacket(goodMessage)
+	assert.NoError(t, err)
+
+	packet := gopacket.NewPacket(data, LayerTypeOMCI, gopacket.NoCopy)
+	assert.NotNil(t, packet)
+
+	omciLayer := packet.Layer(LayerTypeOMCI)
+	assert.NotNil(t, omciLayer)
+
+	omciMsg, ok := omciLayer.(*OMCI)
+	assert.True(t, ok)
+	assert.Equal(t, omciMsg.TransactionID, uint16(0x0022))
+	assert.Equal(t, omciMsg.MessageType, DownloadSectionResponseType)
+	assert.Equal(t, omciMsg.DeviceIdentifier, ExtendedIdent)
+	assert.Equal(t, uint16(2), omciMsg.Length)
+
+	msgLayer := packet.Layer(LayerTypeDownloadSectionResponse)
+	assert.NotNil(t, msgLayer)
+
+	response, ok2 := msgLayer.(*DownloadSectionResponse)
+	assert.True(t, ok2)
+	assert.NotNil(t, response)
+	assert.Equal(t, me.DeviceBusy, response.Result)
+	assert.Equal(t, byte(0x1f), response.SectionNumber)
+
+	// Verify string output for message
+	packetString := packet.String()
+	assert.NotZero(t, len(packetString))
+}
+
+func TestExtendedDownloadSectionResponseDecodeTruncated(t *testing.T) {
+	goodMessage := "0022340b00070001000106"
+	data, err := stringToPacket(goodMessage)
+	assert.NoError(t, err)
+
+	packet := gopacket.NewPacket(data, LayerTypeOMCI, gopacket.NoCopy)
+	assert.NotNil(t, packet)
+
+	failure := packet.ErrorLayer()
+	assert.NotNil(t, failure)
+
+	decodeFailure, ok := failure.(*gopacket.DecodeFailure)
+	assert.NotNil(t, decodeFailure)
+	assert.True(t, ok)
+	assert.NotNil(t, decodeFailure.String())
+	assert.True(t, len(decodeFailure.String()) > 0)
+
+	metadata := packet.Metadata()
+	assert.NotNil(t, metadata)
+	assert.True(t, metadata.Truncated)
+
+	// Verify string output for message
+	packetString := packet.String()
+	assert.NotZero(t, len(packetString))
+}
+
+func TestExtendedDownloadSectionResponseSerialize(t *testing.T) {
+	goodMessage := "0022340b000700010002061f"
+
+	omciLayer := &OMCI{
+		TransactionID:    0x0022,
+		MessageType:      DownloadSectionResponseType,
+		DeviceIdentifier: ExtendedIdent,
+	}
+	request := &DownloadSectionResponse{
+		MeBasePacket: MeBasePacket{
+			EntityClass:    me.SoftwareImageClassID,
+			EntityInstance: 1,
+			Extended:       true,
+		},
+		Result:        me.DeviceBusy,
+		SectionNumber: 0x1f,
+	}
+	// Test serialization back to former string
+	var options gopacket.SerializeOptions
+	options.FixLengths = true
+
+	buffer := gopacket.NewSerializeBuffer()
+	err := gopacket.SerializeLayers(buffer, options, omciLayer, request)
+	assert.NoError(t, err)
+
+	outgoingPacket := buffer.Bytes()
+	reconstituted := packetToString(outgoingPacket)
+	assert.Equal(t, strings.ToLower(goodMessage), reconstituted)
+}
+
 func TestGenericTestResultDecode(t *testing.T) {
 	// ONU-G ME for this test with just made up data
 	payload := "1234567890123456789012345678901234567890123456789012345678901234"
diff --git a/omci.go b/omci.go
index b2995d0..2f6d2d9 100644
--- a/omci.go
+++ b/omci.go
@@ -90,6 +90,10 @@
 // attribute portion of the message contents and does not include the Result Code & Attribute Mask.
 const MaxAttributeGetNextBaselineLength = MaxBaselineLength - 11 - 8
 
+// MaxDownloadSectionLength is the maximum payload size for section data of
+// a Download Section request message for the baseline message set.
+const MaxDownloadSectionLength = 31
+
 // MaxTestRequestLength is the maximum payload size for test request message
 // for the baseline message set.
 const MaxTestRequestLength = MaxBaselineLength - 8 - 8
@@ -109,6 +113,10 @@
 // message contents and does not include the Result Code & Attribute Mask.
 const MaxAttributeGetNextExtendedLength = MaxExtendedLength - 13 - 4
 
+// MaxDownloadSectionExtendedLength is the maximum payload size for section data of
+// a Download Section request message for the extended message set.
+const MaxDownloadSectionExtendedLength = MaxExtendedLength - 11 - 4
+
 // NullEntityID is often used as the Null/void Managed Entity ID for attributes
 // that are used to refer to other Managed Entities but are currently not provisioned.
 const NullEntityID = uint16(0xffff)
