A method for assigning a tributary port number, comprising: receiving a service path request message which is sent by a neighboring node and carries a service type, so as to request to establish a service path used to bear an optical channel data unit, ODU, service of the service type; determining, according to the service path request message, an optical channel transport unit, OTU, link used to bear the ODU service, determining and reserving, according to the service type in the service path request message, a free tributary slot resource used to bear the ODU service in the OTU link, and assigning a tributary port number to the free tributary slot resource, wherein the assigning the tributary port number to the free tributary slot resource comprises: if a multiplex structure identifier, MSI, bytes in the OTU link indicates a service type of the ODU service, obtaining tributary port numbers used by ODU services having the same type as the ODU service in the OTU link and assigning a tributary port number other than the obtained tributary port numbers to the free tributary slot resource; or if the MSI bytes in the OTU link does not indicate a service type of the ODU service, obtaining tributary port numbers used by all types of ODU services in the OTU link and assigning a tributary port number other than the obtained tributary port numbers to the free tributary slot resource and sending a service path acknowledgment message to the neighboring node, wherein the service path acknowledgment message carries information about the free tributary slot resource used to bear the ODU service and the tributary port number assigned to the free tributary slot resource. receiving a service path request message which is sent by a neighboring node and carries a service type, so as to request to establish a service path used to bear an optical channel data unit, ODU, service of the service type; determining, according to the service path request message, an optical channel transport unit, OTU, link used to bear the ODU service, determining and reserving, according to the service type in the service path request message, a free tributary slot resource used to bear the ODU service in the OTU link, and assigning a tributary port number to the free tributary slot resource, wherein the assigning the tributary port number to the free tributary slot resource comprises: if a multiplex structure identifier, MSI, bytes in the OTU link indicates a service type of the ODU service, obtaining tributary port numbers used by ODU services having the same type as the ODU service in the OTU link and assigning a tributary port number other than the obtained tributary port numbers to the free tributary slot resource; or if the MSI bytes in the OTU link does not indicate a service type of the ODU service, obtaining tributary port numbers used by all types of ODU services in the OTU link and assigning a tributary port number other than the obtained tributary port numbers to the free tributary slot resource and sending a service path acknowledgment message to the neighboring node, wherein the service path acknowledgment message carries information about the free tributary slot resource used to bear the ODU service and the tributary port number assigned to the free tributary slot resource.